?
Solved

How display alternate navbars in asp.net

Posted on 2010-08-24
1
Medium Priority
?
396 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

770 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