I’m using a master page to add a search box to the navigation bar on all my pages, but I also have a dedicated search page that has it’s own search box. I would like the navigation search box to show up on every page except the dedicated search page. What’s the best way to accomplish this?
I’m presently including the navigation search box like so:
On normal pages you'll just leave <asp:Content ID="MenuLayout" ContentPlaceHolderID="SearchBoxLayout" runat="server"> out but on the dedicated search page replace it with:
[HIGHLIGHT=ASP.NET]<asp:contentplaceholder id="SearchBoxLayout" runat="server"/>
Alternately, you could put
Panel x = (Panel)Master.FindControl("sSearchBox");
x.Visible = false;
in the Page_Load(object sender, EventArgs e) of search.aspx.cs
I checked the requirement you only need to show navigation search box on every page except the dedicated search page for this in dedicated search page you just need to find the id of searchtextbox on page load event of the dedicated search page and set visible false.