CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 1/12/2007 10:56:56 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 24 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
Grenville
Asp.Net User
Physically adding Sitemap node1/12/2007 10:56:56 AM

0/0

Hi peeps,

I was wondering if there was any way to physically add a sitemap node to the web.sitemap xml file.

I am developing a content management system whereby I would like users to be edit content on existing pages but also to add new pages to their site.

There is a phyiscal aspx page that must exist (this page literally only consists of the page directive), there is also a record of each page in the database which contains its html content. At runtime, the Masterpage determines which page should be rendered by analysing the URL, then outputting the html content that is stored in the database. So to add a new page I just need to create a new aspx page and create a record in the database for it, but I would also want to add it to the sitemap so it appears in the navigation, does anyone know if this could be done?

 Thanks for reading :)

P.S I was also wondering if new empty directories could be created through code (C#), thanks everyone.

Dave Sussman
Asp.Net User
Re: Physically adding Sitemap node1/13/2007 12:12:57 PM

0/0

The sitemap is just a file, so you can open it an add text; you'd probably want to use some of the XML classes to make sure you add the node in the right place. Another alternative, which fits more neatly with a CMS, is to house the menu content within a database; you can still use the SiteMap and Menu by adding a SiteMapProvider that reads the site map data from a database I've written one (http://www.ipona.com/samples/ANV201%20-%20ASP.NET%202.0%20Navigation.zip), but there's also one in he Provider Toolkit (http://msdn2.microsoft.com/en-us/asp.net/aa336558.aspx), which is probably simpler than mine. The creation of new nodes then simply becomes the addition of a row into the database.

For creating files have a look at the System.IO namespace; there is a File class and FileInfo class, both of which have a Create method.

Dave

Grenville
Asp.Net User
Re: Physically adding Sitemap node1/15/2007 10:46:54 AM

0/0

That's great Dave, thanks for your help.

I was thinking that it would be great to use a database to store sitemap info, and didn't realise you could extend the provider so easily.

I ended up implementing an Access Sitemap Provider which works good - I was a little confused at first as to how you could add custom providers but I should have looked into it earlier, for those who are unsure like I was, here's how to add an Access Sitemap Provider;

1) Go to this page http://msdn2.microsoft.com/en-us/library/ms178434(VS.80).aspx, copy the code in the relevant language into a new class in the App_Code folder and save it.

2) Create a new Access database and call it Sitemap.mdb (use the SQL code found in the link and paste in into the SQL view of a query, and execute - *NB for some reason I had to add my own Primary Key and change Int32 to just Int).

3) Add the provider information into your web.config file remember to include the full namespace in your type field.

I think I understand this pretty well now, so post to this thread if you think I can help.

Thanks again.

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 2.0 Databases Authors: Thiru Thangarathinam, Pages: 504, Published: 2007
Professional ASP.NET 2.0 Security, Membership, and Role Management Authors: Stefan Schackow, Pages: 611, Published: 2006
Professional Visual Studio 2005 Authors: Andrew Parsons, Nick Randolph, Pages: 869, Published: 2006
ASP.NET 2.0: A Developer's Notebook Authors: Wei Meng Lee, Pages: 326, Published: 2005
Essential ASP.Net 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2006
ASP.NET 3.5 For Dummies Authors: Ken Cox, Pages: 404, Published: 2008
Encyclopedia of Microcomputers: Volume 23 - Supplement 2 - An Analysis of the Pre-Physical Database Design Heuristics to Thermal Investigations of ICs and Microstructures Authors: Allen Kent, James G. Williams, Rosalind Kent, Pages: 500, Published: 1999
Communicating Design: Developing Web Site Documentation for Design and Planning Authors: Daniel M. Brown, Pages: 352, Published: 2006
Designing Web Interfaces: Hypertext and Multimedia Authors: Michael Rees, Mike Rees, Andrew White, Bebo White, Pages: 400, Published: 2001
Mastering Web Development with Microsoft Visual Studio 2005 Authors: John Paul Mueller, Pages: 822, Published: 2005

Web:
Physically adding Sitemap node - ASP.NET Forums Physically adding Sitemap node. Last post 01-15-2007 5:46 AM by Grenville. 2 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
ASP.NET Adding Dynamic Nodes to Sitemap Path | Michael Fraser ... Jan 14, 2007 ... NET Adding Dynamic Nodes to Sitemap Path ... public static SiteMapNode addNode( Object Sender, SiteMapResolveEventArgs e) ...
MSDN SharePoint - Development and Programming SiteMapNode ... SiteMapNode.ChildNodes.Count =0 while SiteMapNode.HasChildNodes = true? ... the SiteMapNode object representing the default page is not physically contained ...
ASP.NET.4GuysFromRolla.com: Examining ASP.NET 2.0's Site ... Mar 8, 2006 ... Adding Custom Attributes to the Site Map's Nodes ..... one that bases the site map on the website's physical, file system structure. ...
Sitemaps.NET - James Newton-King If a SiteMapNode doesn't have a lastmod date and this option is true then Sitemaps.NET will attempt to get the lastmod date from the physical file. ...
IT Resource Center forums - Adding a test-rig node to VMS cluster ... Adding a test-rig node to VMS cluster. ... Unless all nodes agree, and use the same physical files you can get some very odd behaviour. ...
Adding and Removing a Cluster Node (Sun Cluster System ... The following table lists the tasks to perform when adding a node to an existing cluster. .... If no, to physically remove the node from the cluster, ...
ASP.NET See this to know abt SiteMap Jul 3, 2008 ... You can place as many additional elements as you want. Additional link-levels can be created by adding child ...
SiteMapPath: Can I add node the following way? - .NET ASP My problem is I am ask to insert a 'provider' in SiteMapNode. ... hierarchy ( logically, as the physical pages do not have to correspond to ...
15 Seconds : An Introduction to the ASP.NET 2.0 Navigation Controls The URL for the deepest node in your sitemap can be in the root of your site and ... Simply put, a file's physical location has no bearing on where the page ...




Search This Site:










changing masterpage label from masterpage code behind

treeview selectednodestyle background problem.

how to cache server control on master page

how to allow only one node expansion in treeview?

default button when using a masterpage

block page by direct url

web application and master pages

any way to use a .gif as the pathseparator in the sitemappath control?

horizontal menu problem

invalid theme or stylesheet theme value in vs 2008

sitemapnode with custom attrbiutes (sqlsitemapprovider)

wizard help in asp.net

how to use the master page

using asp:table in master page makes design view not useable for content pages

disabled checkbox in treeview

<location><authorization> problems!

masterpages and images

communicating between master page and child(x3) page

object groups in skins

dynamic image paths

i have problem with master page

[c#] change the session culture

databinding and refreshing treeview asp.net 2.0

error in path of masterpage

simple html menu

master page will not allow request.form values to return data

populating a treeview dynamically

dynamic menu modification

xpath help

how to access masterpage class outside of the app_code folder

  Privacy | Contact Us
All Times Are GMT