[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How display alternate navbars in asp.net

Posted on 2010-08-24
1
Medium Priority
?
399 Views
Last Modified: 2012-05-10
I need to have a different navbar load  when a user clicks the Navbar1 or Navbar2 button, see code below from my master page. I'm using asp.net 4.0 (VB) and CSS

                <div id="navbarTop">
            <ul>
                <li><a href="../Default.aspx" id="top-home">Home</a></li>
                <li><a href="../About.aspx" id="top-about">About Us</a></li>
                <li><a href="../default1.aspx" id="nav1">Navbar1</a></li>
                <li><a href="../default2.aspx" id="nav2">Navbar2</a></li>
            </ul>
            </div>
<!--this is the default navbar and displayed when user clicks NavBar1 button
            <div id="navbar1">
            <ul>
                <li><a href="../page1.aspx" id="p1">button1</a></li>
                <li><a href="../page2.aspx" id="p2">button2</a></li>
                <li><a href="../page3.aspx" id="p3">button3</a></li>
            </ul>
            </div>
<!--display this navbar when user clicks NavBar2 button
            <div id="navbar2">
            <ul>
                <li><a href="../page4.aspx" id="p4">button4</a></li>
                <li><a href="../page5.aspx" id="p5">button5</a></li>
                <li><a href="../page6.aspx" id="p6">button6</a></li>
            </ul>
            </div>
-->

Open in new window


Thanks.
0
Comment
Question by:TARJr
1 Comment
 
LVL 2

Accepted Solution

by:
SandyAgo earned 1000 total points
ID: 33517004
Firstly, just wrap both navbar1 and navbar2 in <asp:panel ID="..." runat="server" visible="false">

Then in your coe, your navbar1 and navbar2 links both go to different aspx pages. If this is what you are actually trying to do then you can just send the visibility you require back up to the master page during page load. See this article:

http://www.4guysfromrolla.com/articles/013107-1.aspx

hey presto, you can set visible=true when you load from the different pages (default1.aspx and default2.aspx)


         
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question