I developed a module used to display search results but am having problems using it in multiple places on the website. I am at a bit of a loss as to how approach debugging this problem. If anyone knows what is happening or has any advice, please help and it will be greatly appreciated. The following is my problem:
In quick simple terms, the module is not loading when accessed via a post back from another page on the website. The module works fine on one page but does not work when placed on another page. A more detailed explanation follows....
The site I am working has a search form on every page so a user can easily submit a product search from anywhere on the site. When the user submits the search, the search variables are posted and the form action is directed to the search results page.
My site is logically divided into several sections, each representing one company within the corporation. Here is a screenshot of what the page management view looks like,
http://s14.postimg.org/8nh7rxy01/Page.... Within each of the sections, there is a search results page that contains an instance of the Search Results module I developed. When the user is on any page within the Corporate section of the site and submits a search, they are taken to the search results page contained in the Corporate section. Likewise, if the user is on a page within another section when the search is submitted, they will be taken to the search results page in their current section.
Everything works as expected in the Corporate section. While on the section homepage I can submit a search and get results. I can also be on the search results page after submitting a search, and perform another search.
When in other sections of the site, I am not getting the same result. In any other section, searches are only executing successfully in limited cases. Searches are executed successfully only when I first navigate to the Search Results, then submit the search while on the search results page. If I submit a search from any other page, the module does not load and all I see on the search results page is the content from the selected page template.
I have done some debugging and have observed the following:
- The code appears to execute the same way no matter where the search submission originates.
-
When debugging I can see that the posted search form values are detected, the search is executed, and the HTML string representing search results is created and written to the screen via the innerText property of a DIV tag.
-
Although the search will work if the search results page is first loaded in the browser, after submitting a search that does not display successfully, subsequent searches from the search results page will fail until the page is manually reloaded without a post back.
-
When the page fails, nothing is written to the log file.
-
I suspected a code error so I removed stopped all code from executing by putting a return statement at the start of the page_load. In this case, I would expect the structural elements of the module to load, but that they would not be filled in. Even with the code removed, submissions from other pages would not load the module, and submissions from the same page would load the module.
It seems like DNN just isn't loading the module for some reason. What could be going on here or what should I look at to start a debugging process?
Thanks