Jeff Prosise has a nice article on MSDN magazine about SqlSiteMapProvider. The provider is an update to the SqlSiteMapProvider in Microsoft Provider Toolkit which was authorized by the same author.
After using the provider in my website, I found that I have to change a few things:
- Changed the stored procedures to use Common Table Expression so that records where sorted in order even if they were populated out of order.
- Use the URL as key. The reason is that otherwise the items on a menu control that corresponds to the current page would not appear to be automatically selected. An alternative way to work around this problem is in this Danny Chen's blog.
- The SqlSiteMapProvider does not allow external URLs but the XmlSiteMapProvider does allow external URLs. The fault was really in StaticSiteMapProvider from which SqlSiteMapProvider was inherited from. The XmlSiteMapProvider overrides the AddNode method of StaticSiteMapProvider. Since the AddNode method was declared as internal override, we cannot override it. A workaround is to use an internal redirect page to redirect to an external URL.