Home All Groups Group Topic Archive Search About

Best way to have multiple pages show up as same selection on menu

Author
14 Feb 2006 6:42 PM
Corleen
Hello
I'm new to ASP.net 2.0 and am trying to work with the menu control.  I've
setup a sitemap for my main pages and a menu control on a master page.  When
an item is chosen on the menu control, that item stays highlighted via my
static property. Works just fine.

One of my pages consists of a web control with a grid and then needs to show
different items from the grid in tabbed pages at the bottom.  I was going to
create a different page for each 'tab' of data and add the web control with
the grid to the top. I would like my menu control to stay highlighted when
the pages change to one of the ones that is still part of the group.

For example, I would have EditRecordAddresses.aspx, EditRecordMisc.aspx, and
EditRecordClasses.aspx.  But I want EditRecord to stay highlighted on my menu
when I switch between these pages. 

Could someone give me an idea of best way to do this or direct me to an
article ?

Thanks!

Corleen

Author
14 Feb 2006 8:41 PM
DWS
Carleen,
Here's your idea menuitemdatabound event maybe you could getsomething like
this to work.

if SiteMap.Provider.CurrentNode.NextSibling.Url = page.Request.RawUrl then
e.selected = true.
endif

Good Luck
DWS




        End If

Show quoteHide quote
"Corleen" wrote:

> Hello
> I'm new to ASP.net 2.0 and am trying to work with the menu control.  I've
> setup a sitemap for my main pages and a menu control on a master page.  When
> an item is chosen on the menu control, that item stays highlighted via my
> static property. Works just fine.
>
> One of my pages consists of a web control with a grid and then needs to show
> different items from the grid in tabbed pages at the bottom.  I was going to
> create a different page for each 'tab' of data and add the web control with
> the grid to the top. I would like my menu control to stay highlighted when
> the pages change to one of the ones that is still part of the group.
>
> For example, I would have EditRecordAddresses.aspx, EditRecordMisc.aspx, and
> EditRecordClasses.aspx.  But I want EditRecord to stay highlighted on my menu
> when I switch between these pages. 
>
> Could someone give me an idea of best way to do this or direct me to an
> article ?
>
> Thanks!
>
> Corleen
Author
17 Feb 2006 1:25 AM
Corleen
The MenuItemDatabound event was the perfect spot.  I just did:

If e.Item.NavigateUrl.ToUpper =
SiteMap.Provider.CurrentNode.ParentNode.Key.ToUpper Then
            e.Item.Selected = True
        End If

I love it when problems can be solved with one or two lines of code.

Thanks!
Corleen
Show quoteHide quote
"DWS" wrote:

> Carleen,
> Here's your idea menuitemdatabound event maybe you could getsomething like
> this to work.
>
> if SiteMap.Provider.CurrentNode.NextSibling.Url = page.Request.RawUrl then
> e.selected = true.
> endif
>
> Good Luck
> DWS
>
>
>
>
>         End If
>
> "Corleen" wrote:
>
> > Hello
> > I'm new to ASP.net 2.0 and am trying to work with the menu control.  I've
> > setup a sitemap for my main pages and a menu control on a master page.  When
> > an item is chosen on the menu control, that item stays highlighted via my
> > static property. Works just fine.
> >
> > One of my pages consists of a web control with a grid and then needs to show
> > different items from the grid in tabbed pages at the bottom.  I was going to
> > create a different page for each 'tab' of data and add the web control with
> > the grid to the top. I would like my menu control to stay highlighted when
> > the pages change to one of the ones that is still part of the group.
> >
> > For example, I would have EditRecordAddresses.aspx, EditRecordMisc.aspx, and
> > EditRecordClasses.aspx.  But I want EditRecord to stay highlighted on my menu
> > when I switch between these pages. 
> >
> > Could someone give me an idea of best way to do this or direct me to an
> > article ?
> >
> > Thanks!
> >
> > Corleen
Author
15 Feb 2006 4:40 PM
Bob Chauvin ( Paix dehors )
How about using the asp wizard control?

Show quoteHide quote
"Corleen" <cjaschn***@yahoo.com> wrote in message
news:3973A381-E053-4614-B37F-A682BAE3A02C@microsoft.com...
> Hello
> I'm new to ASP.net 2.0 and am trying to work with the menu control.  I've
> setup a sitemap for my main pages and a menu control on a master page.
> When
> an item is chosen on the menu control, that item stays highlighted via my
> static property. Works just fine.
>
> One of my pages consists of a web control with a grid and then needs to
> show
> different items from the grid in tabbed pages at the bottom.  I was going
> to
> create a different page for each 'tab' of data and add the web control
> with
> the grid to the top. I would like my menu control to stay highlighted when
> the pages change to one of the ones that is still part of the group.
>
> For example, I would have EditRecordAddresses.aspx, EditRecordMisc.aspx,
> and
> EditRecordClasses.aspx.  But I want EditRecord to stay highlighted on my
> menu
> when I switch between these pages.
>
> Could someone give me an idea of best way to do this or direct me to an
> article ?
>
> Thanks!
>
> Corleen