HighTechTalks DotNet Forums  

simple link disabling on current page

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss simple link disabling on current page in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
jonefer
 
Posts: n/a

Default simple link disabling on current page - 02-02-2007 , 06:40 PM






Steve C Or has an article 'Automating Navigational Chores'--- .
(which, don't get me wrong-- it's really nice, but I can't use the colorful
panels for my business solution)

Can someone help me remove the reference to the panels and just create
simple Text hyperlinks?

===Code=====

'loop through each child node

'and create a hyerlink to the page.

For Each Child As SiteMapNode In SMN.ChildNodes

pnl.Controls.Add(New LiteralControl("&nbsp"))



If Child.Url.Length > 0 AndAlso _

SiteMap.CurrentNode.Url = Child.Url Then

'if the link is to the current page

'then don't display a hyperlink

pnl.Controls.Add(New LiteralControl("<b>" & _

Child.Title & "</b>"))

Else

'display a hyperlink to the page

Dim h As WebControls.HyperLink = _

New WebControls.HyperLink()

h.NavigateUrl = Child.Url

h.Text = Child.Title

h.ToolTip = Child.Description

pnl.Controls.Add(h)

End If

CreateIcon(Child, pnl)

pnl.Controls.Add(New LiteralControl("<br/>"))

Next

My site has a 'Member search' page and an 'Appointments' page... basically
these - so far are the only links that I want to use a 'SiteMapPath' (bread
crumbs) with.

There are 2 other pages, a 'User Admin' and 'Control Panel' that I don't
mind manually writing code to hide them.

But I built a master page, and would like to use the SiteMap to determine a
simple solution to disable the Member Search page - "FindMember.aspx" (which
is also the home page) only show the Appointments link.. and Visa Versa (show
the Member search link) when on the Appointments page.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.