View Full Version : Web.Sitemap...


Sergeant
01-16-2006, 12:42 PM
My "Organization" page has a datalist control that lists the sections in my organization (from a database).
I plan to build a hyperlink into each section title that will open a staffdirectory.aspx page that will list the employees and contact info. The link will be like "staffdirectory.aspx?sectionID=1".
I only have one staffdirectory page...how do I use a menu with the Web.Sitemap file, and also account for there being a changeable list of sections?

Kodo
01-16-2006, 02:38 PM
are the sections stored in the db?

Sergeant
01-16-2006, 04:14 PM
Yes, for future flexibility. For menu purposes, some pages are fixed, and others use querystring.

Kodo
01-16-2006, 06:07 PM
ready to learn about classes and objects?
What I would do is pull the data from the database, populate a class that deserializes to an xml document (all in memory) and then save that xml document to the file system. You would do this everytime you added a section so it would be more or less a function that happens when new sections are added. You don't want to load the xml from the db like that all the time because the changes would probably far and few between aside from an extra hit on the db,server and network traffic.

Refer to my samples for serialization info. Note that the Xmldocument object in .net has a .save() method so you can save it to a path.

Sergeant
01-16-2006, 06:54 PM
Thanks mate, I think that's just what I need.
I shall look into it tomorrow.
GoodNight