PassMark Logo
Home » Forum

Problem on Master Page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mhossack
    Junior Member
    • Sep 2008
    • 3

    #1

    Problem on Master Page

    Hi,

    I'm having a problem when running the search on a master page in asp.net.

    I have a search box in the top corner of the master page which goes to the search results page when the button is clicked. When on the results page, if I type something different in the main search box (the zoom generated one) the original query is retained when I click the Submit button.

    I saw a thread with a similar problem (http://www.wrensoft.com/forum/showthread.php?t=2339&highlight=master) but none of the suggestions in that seemed to work in my case. I've gone through all the suggestions in the FAQ as well.

    I've tried putting a master page without the search in the corner onto the search page but still have the same problem.

    Thanks
  • David
    Administrator
    • Dec 2004
    • 4714

    #2
    Can you post the URL to the search function so that we can see the problem.

    Comment

    • mhossack
      Junior Member
      • Sep 2008
      • 3

      #3
      The URL is http://www.mcclurenaismith.com/dotnet/search/search.aspx

      Thanks.

      Comment

      • Ray
        Administrator
        • Dec 2004
        • 4357

        #4
        When implementing the search function in ASP.NET master pages, you can not use any normal HTML <form> tag because the master page has an all-encompassing form around the entire page. And you can not have a form tag within another form tag.

        This means the generated search box will not work on ASP.NET master pages. In these cases, you should disable the generated form (on the "Search Page" tab of the Configuration window, change the "Search form:" dropdown from "Advanced" to "Do not generate") and use the same form that you have placed on your other ASP.NET pages (which does not use a <form> tag but relies on JavaScript to submit the form).

        This is a limitation in the design of ASP.NET. The same is true if you wanted to add a search box to Google, or a HTML form for a Comments script, etc.

        You can find more information on this in a previous discussion thread.
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment

        • mhossack
          Junior Member
          • Sep 2008
          • 3

          #5
          Thanks for clearing that up Ray.

          Got it working great now.

          Mark

          Comment

          Working...