C# - How To Get The Name Of Sitemap File From Sitemap Provider
Oct 6, 2010
I am creating a CacheDependency on the file that my SiteMap provider uses. I would like to get the name of the file from my sitemap provider instead of hard coding it. Is there a way?
Edit
Duh, I forgot to mention: XmlSiteMapProvider that comes with ASP.NET
Edit 2
Reflector shows a private member field called _filename that isn't exposed in any way as far as I can tell.
View 1 Replies
Similar Messages:
May 11, 2010
We are getting this error message when we try to click the link in the menu to go to Report Server:
Source Error:
Line 31: <siteMapNode title="Reports" description="Reports">
Line 32:
Line 33: <siteMapNode url="https://ffxsqldgc01.ffx.co.fairfax.va.us/Reports/Pages/Folder.aspx?ItemPath=%2fDPZ&ViewMode=List" title="View Reports"
description="Click here to view the reports" />
Line 34: </siteMapNode>
Line 35:
I tried to add after the &, as it was suggested on one of the forum but it did not work. Any other ideas.
View 5 Replies
Nov 4, 2010
How would I programatically reference a .sitemap file that is not the root web.sitemap file? I have a file called research.sitemap in a folder a level under root. I want to refernce this file in my code behind like his: SiteMapNode m1 = SiteMap.RootNode (but since this isnt web.sitemap in the root, I dont know how to get access to it).
View 1 Replies
Aug 2, 2010
I've been having some production runtime errors that I don't fully understand. This has happened to us on a couple different ASP.NET 4.0 Web Sites (shudders - yes, I know - we're porting it to MVC but that's taking some time).
First of all, we have never been able to reproduce this issue in development/QA environments. Secondly, upon deployment, the issue seems to be non-existent. Sometimes the issue manifests within a day or two of deployment and other times the deployment will be live for a month without it manifesting at all. However, once it manifests, then ANY page viewed under the web site causes the error. Lastly, this problem seemed to only come up once we migrated to .NET 4.0. We started at 2.0, a year ago upped to 3.5, and recently upped to 4.0 with this solution and most child projects.
The error:
Could not find the sitemap node with URL '~/Default.aspx'.
A simplified version of our sitemap (with some names changed and uninteresting nodes removed) is as follows:
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode roles="*" title="EG">
<siteMapNode url="~/../SM/Default.aspx" title="Welcome" description="" roles="*" />
<siteMapNode url="~/../SD/Default.aspx" title="SD" description="" roles="*" />
<siteMapNode url="~/../SMD/Default.aspx" title="SMD" description="" roles="*" />
[code]...
I have confirmed in all of the SiteMaps that there is a node with url="~/Default.aspx" with roles="*" (which includes public/anonymous access), so I am very confused as to why this problem occurs.
SiteMap does not have a node for Default.aspx. All of them do. SiteMap's Default.aspx node is not accessible for security reasons to the current user/role. They're all accessible to anonymous users and this problem even exists for super admin users. Passed-in URL contains querystrings (Default.aspx?abcd). I don't know if this is a problem (I sure would hope not) but once the problem manifests itself, I can handwrite the URL with no querystrings and the problem still exists.
SiteMap changes. It doesn't Service's permissions to the sitemap file. The sitemap works perfectly fine after a deployment, so unless permissions are changed in a way that IISRESET fixes, then this is not an issue. The worker process becomes globally corrupt. I don't think so. We have ~12 web sites all in the same app pool and the problem always stays confined within a single web site. Also, we have yet to have this happen to more than a single web site at a time although it has manifested itself in 4 different ones so far.
View 1 Replies
Jan 25, 2011
I've got a custom menu navigation built from a web.sitemap file, the first line of this would be something like:
SiteMapNodeCollection topLevelNodes = SiteMap.RootNode.ChildNodes;
However, now I want to be able to create multiple web.sitemap files, and then programmatically determine which web.sitemap file to use, but I can't seem to find out how to do this. I'm assuming I could either create one custom SiteMapProvider that can perform the logic to determine which web.sitemap file to load, or I have multiple providers, each one with the SiteMapFile property set to a specific *.sitemap file, and then switch providers programmatically before I access SiteMap.RootNode.
View 2 Replies
Apr 24, 2010
I've tried this guide: http://mvcsitemap.codeplex.com/Thread/View.aspx?ThreadId=208090I've added dll "MvcSiteMap.Core.dll" i referencesAnd I've added namespaces in web.config: "<add namespace="MvcSiteMap.Core" />"When I'm entering the web page comes this message:
Line 49: </runtime>Line 50: Line 51: <siteMap defaultProvider="MvcSiteMap">Line 52: <providers>Line 53: <add
View 3 Replies
Mar 21, 2010
I have seen a lot of examples posted on how to create a Custom SiteMap Provider which is directly linked to the Business Logic in the Presentation Layer, however, I would like to write a Custom SiteMap Provider which inherits from StaticSiteMapProvider and
is driven by the database. In addition, I would like to expose all of this logic behind WCF Services.
Are there any samples on how to implement a Custom SiteMap Provider over WCF Services since I am having a hard time trying to figure out exactly how to put a solution following this architectural pattern together.
View 1 Replies
Dec 13, 2010
I want to add/edit available siteMap providers in web.config file from code behind.
I am using the siteMap providers currently in the application web.config in a format given below:
<siteMap>
<providers>
<add siteMapFile="~/App_Themes/MyAppDefault/MySiteMap.sitemap"
name="MyAppDefault" type="System.Web.XmlSiteMapProvider" />
</providers>
</siteMap>
This is allowing my application user to show up a different Site Map as and when the theme is changed.
But when I tried to do the same with the following code I faced with an issue.
configuration = WebConfigurationManager.OpenWebConfiguration("~")
section = CType(configuration.GetSection("system.web/siteMap"), SiteMapSection)
Dim provider As New ProviderSettings()
If Not section Is Nothing Then
provider.Name = txtError.Text
provider.Type = "System.Web.XmlSiteMapProvider"
section.Providers.Add(provider)
configuration.Save()
End If
This code is not allowing a provider.siteMapFile property (provideer is the ProviderSettings object).
As well the maximum possible way I can add a new SiteMap provider in web.config is as follows
<siteMap>
<providers>
<add name="MyAppCustom" type="System.Web.XmlSiteMapProvider" />
</providers>
</siteMap>
If anybody can suggest a way for me to add/edit the 'siteMapFile' attribute of the provider.
View 1 Replies
Mar 25, 2010
I have a second level node that goes onto two lines. The first line indents 15px as is set by the class for node level 2. The seond line kicks back to the same level as 1st level nodes. Here's what I mean:
Parent Node
Second node
line 2 of second node
I want it to be like this:
Parent Node
Second Node
line 2 of second node
View 4 Replies
May 13, 2010
I was referred here by MSDN forums hope this is the right place - I have a custom control (:WebControl) that renders web.sitemap in a specific way. While it runs error free and produces the expected result, at Design-Time it complains
[Code]....
and have tried the SiteMapDataProvider Tag with and without the SiteMapProvider
attribute.Does anybody have (a) any experience with this, or (b) any suggestions as to how to track down the problem?
View 3 Replies
Nov 9, 2010
How would I generate a sitemap xml file dynamically from vb.nert code?
View 1 Replies
May 18, 2010
How are you going to pass a viewdata into the sitemap file?
<%= Html.ActionLink("Home", "Index", "Home", new { id = ViewData["customRouteValue"] })%>
View 1 Replies
May 27, 2010
what is the function of sitemap file? i would like to create a user access to different aspx file, how to do?
View 2 Replies
Mar 21, 2011
I am having a problem with my web.sitemap I am getting the errorr:
"The file web.sitemap required by XmlSiteMapProvider does not exist."I have searched for this and the only thing I have read is that the file is actually not placed in the root directory on the server. I have made 110% sure it is in the root directory then i tried many times moving it back and forth from the actual project folder then deleting it and moving to the root directory about 10 times and cannot figure out whats going on...
View 1 Replies
Aug 26, 2010
I added web.sitemap file in my project.on Debug it shows an exception like this"The file
web.sitemap required by XmlSiteMapProvider does not exist."
how to solve the above error and any changes made in web.config file after adding web.sitemap file?
View 3 Replies
Oct 25, 2010
I have a sitemap file included in a asp.net masterpage that I want to use CSS to format. Unfortunately, I'm having some problems getting the web.sitemap file to read the CSS file. The following is my code for the Web.sitemap file. Could someone give me the code for getting my document to read the CSS file. The following is a copy the code I have now.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="Staff Admin Menu" description="" forecolor="white">
<siteMapNode url="Default2.aspx" title="> Default2" description=""/>
<siteMapNode url="HomePage.aspx" title="> HomePage" description="" />
<siteMapNode url="GoogleForm.aspx" title="> Google" description="google" />
<siteMapNode url="FacebookForm.aspx" title="> Facebook" description="google"/>
</siteMapNode>
</siteMap>
View 4 Replies
Jan 7, 2010
Is there any way to integrate images in my sitemap toolbar instead of the default text? And if so how?
View 4 Replies
Aug 19, 2010
I've been searching Google for some answers and failed! Nothing has worked yet. Yes the Web.Sitemap is on the server.
Here is my web.config.
[Code]....
Here is my web.sitemap
[Code]....
I'm not sure if being hosted on a shared web server from aspnix or even having it in a sub domain may be the issue. This is my first time using the sitemap control.
View 5 Replies
Apr 22, 2010
I have a CMS that allows an administrator to add/create pages for his website.
When a page is created a SiteMapNode is added to the web.sitemap file with the an url , title and resourceKey.
Now I wish to add a resourcekey to the appropriate web.sitemap.resx file(located in App_GlobalResources).
I have tried many different ways :
- using XMLDocument load/save => says I don't have access to write to that resource file
- ResourceReader says the source stream is not valid.
View 4 Replies
Mar 10, 2011
I took over a rather large C# .NET 2.0 legacy web application from a colleague who is no longer available. This web application consists out of multiple projects in one solution. And I ran into a problem that I simply do not understand and hopefully somebody here will. The application has multiple .sitemap files included in a sitemap subfolder. So far so good. But I found one .sitemap file that was floating around in the root of the web project and is not used anywhere in the application (it's not included in the web.config).
I excluded this file. The web application runs fine without it. All menu's load correctly. Until I hit a method that uses recursion to look for certain controls (NOT the sitemap!). This method runs down through all controls from a given point and then crashes on the fact that the XMLSitemapProvider is missing this one file. This method is called many times without issues, but when the user logs out it somehow runs through a hierachical path of controls that eventually end up at the missing .sitemap file. The file also needs to be at this exact location in the root. Moving it somewhere else will cause the same crash. The file web.sitemap required by XmlSiteMapProvider does not exist.
I have searched for this filename and all ".sitemap" files but can not find it anywhere in the solution. 0 results found. I've ran past all the code leading up to the crash and it seems arbitrary (it has nothing to do with the sitemaps). The crash just happens because it hits the XmlSiteMapProvider looking for another control when it's going through all controls. In short, I can find no references what so ever to this file!
Since this web application is huge I can not manually go past every section of code. There is hundreds of thousands of lines of code. Does anybody know any other way then through the web.config to include a sitemap or how a sitemap file could be registered and where I should look? Final note: this application used localization. The sitemap's are localized and I found resources for this one sitemap. I hoped excluding those would solve the problem. Unfortunately it didn't.
View 1 Replies
Oct 7, 2010
I have a problem with binding a menu control to a sitemap file dynamically.
the files...
[code]
this files are into the 'tesorera' folder in the estructure of my project
When I run the project there aren't errors but I can't see the menu items of the sitemap file, I only see the 'siteMap' word in the menu .... why?
View 5 Replies
Aug 6, 2010
I have been developing a menu using menu control and sitemap but i got the following error.
The file web.sitemap required by XmlSiteMapProvider does not exist.
View 1 Replies
May 7, 2015
I have an accordion menu like this :
Builder ( Main UL , without href )
Create Builder ( Navigates to CrtBuilder.aspx)
Remove Builder ( Navigates to RmvBuilder.aspx)
Supplier (Main UL)
Create Supplier ( Navigates to CrtSupplier.aspx )
Remove Supplier Navigates to RmvSupplier.aspx
Now if a user clicks on CreateBuilder Menu then the user must see the site map in my breadcrumb like this :
Home > Builder > Create Builder
same way for supplier :
Home > Supplier > Create Supplier
remember ( on clicking Home the page must navigates to abc.aspx)
View 1 Replies
Oct 26, 2013
I have menu control bind with website map. I have added some new links in my menu so I want to add a icon "New reports" so user can view it.
How to add icon in website map file with link.
View 1 Replies
Dec 24, 2010
I m using multiple sitemaps in my website. The providers are defined in web.config file as:
[Code]....
[Code]....
Now I m trying to modify one of my xml file in memory to dynamically populate querystring but when I use
Dim currentNode
As
SiteMapNode =
SiteMap.CurrentNode.Clone(True)
I get Null in my currentNode and I cant point to the node.
View 5 Replies