Solved

How display alternate navbars in asp.net

Posted on 2010-08-24
1
389 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 250 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can I build my own IDE using ASP.NET MVC? 2 43
IP API - need data... 4 23
How can my static class become undefined?? 8 47
tutorial for ebay api 3 32
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now