Re: How do I do these dynamic links in ASP.NET ?
From: Karl Seguin (_at_)
Date: 01/31/05
- Next message: Ludvig: "Re: One web.config, for multiple domains"
- Previous message: Jay: "Re: Reference Datagrid Footer Control"
- In reply to: Alan Silver: "How do I do these dynamic links in ASP.NET ?"
- Next in thread: Alan Silver: "Re: How do I do these dynamic links in ASP.NET ?"
- Reply: Alan Silver: "Re: How do I do these dynamic links in ASP.NET ?"
- Reply: Alan Silver: "Re: How do I do these dynamic links in ASP.NET ?"
- Reply: Alan Silver: "Re: How do I do these dynamic links in ASP.NET ?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 31 Jan 2005 13:01:03 -0500
Alan:
The community starter kit has a well-setup breadcrump component (but it's
database driven). You might want to check it out.
The way I've always seen it set up is via a user control which you include
atop each of your page. The user control would then be fed off an XML file
or Database where it would use the current page to figure out what
breadcrumb to build. This is more elegant than the MakeLink "xxx", "yyy"
solution because it makes the user control totally self-sufficient as well
as making it easily modifiable via an XML file (as oppsed to having to
hard-code the links on each page)
You can also get free controls to do this for you:
http://www.loudcarrot.com/webcontrols/navpath.aspx
Normally it's done simply by reading data into some type of collection (say
an arraylist) and binding that to a datagrid...
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ "Alan Silver" <alan-silver@nospam.thanx> wrote in message news:IawZTDL9Vl$BFw3r@nospamthankyou.spam... > 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>" & TocText & "") > 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 > > -- > Alan Silver > (anything added below this line is nothing to do with me)
- Next message: Ludvig: "Re: One web.config, for multiple domains"
- Previous message: Jay: "Re: Reference Datagrid Footer Control"
- In reply to: Alan Silver: "How do I do these dynamic links in ASP.NET ?"
- Next in thread: Alan Silver: "Re: How do I do these dynamic links in ASP.NET ?"
- Reply: Alan Silver: "Re: How do I do these dynamic links in ASP.NET ?"
- Reply: Alan Silver: "Re: How do I do these dynamic links in ASP.NET ?"
- Reply: Alan Silver: "Re: How do I do these dynamic links in ASP.NET ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|