A
Alan Silver
Hello,
I Classic ASP, I used to have a standard way of making the top-level
site navigation links. I had an include file which included a Sub like
this ...
Sub MakeLink(TocURL, TocText)
If TocURL = ThisURL Then
Response.Write("<br>" & TocText)
Else
Response.Write("<br><a href=""" & TocURL & """>" & TocText & "</a>")
End If
End Sub
(air code, so ignore typos), where ThisURL had been set to the URL of
the current page. I could then do something like ...
MakeLink "/", "Home"
MakeLink "/contact.asp", "Contact Us"
and so on. This include file could then create a set of links for every
page.
Now, how do I achieve the same end in ASP.NET? I guess I could have a
label in the place where I want the links to be, then have a sub in the
Page_Load event that builds a string containing the HTML. At the end of
the sub, the label.Text could be set to the string.
This seems a little inelegant considering the way ASP.NET is set up to
allow structured coding. Does anyone have a better suggestion for this?
TIA
I Classic ASP, I used to have a standard way of making the top-level
site navigation links. I had an include file which included a Sub like
this ...
Sub MakeLink(TocURL, TocText)
If TocURL = ThisURL Then
Response.Write("<br>" & TocText)
Else
Response.Write("<br><a href=""" & TocURL & """>" & TocText & "</a>")
End If
End Sub
(air code, so ignore typos), where ThisURL had been set to the URL of
the current page. I could then do something like ...
MakeLink "/", "Home"
MakeLink "/contact.asp", "Contact Us"
and so on. This include file could then create a set of links for every
page.
Now, how do I achieve the same end in ASP.NET? I guess I could have a
label in the place where I want the links to be, then have a sub in the
Page_Load event that builds a string containing the HTML. At the end of
the sub, the label.Text could be set to the string.
This seems a little inelegant considering the way ASP.NET is set up to
allow structured coding. Does anyone have a better suggestion for this?
TIA