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
I am trying to update the enablePasswordReset from false to true programmatically but am struggling.. This is as far as I got!
ConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); var section = (MembershipSection)config.GetSection("system.web/membership"); var defaultProvider = section.DefaultProvider; var providerSettings = section.Providers[defaultProvider]; // Now what?
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.
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.
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.
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
I have code for C# but I need code for VB.NET. When I try converting this code to VB.NET I get more errors. convert this code to VB.NET. For programmers who know C# and VB.NET this converting take about 10 minutes. It consists of a derived XmlSiteMapPRovider as suggested by Steve, and an accompanying web admin page, allowing view/edit/add/delete of the sitemap nodes. it assumes unique titles in all pages, which may not be true for other apps, the code could easily be modified to specify a key or other attribute.
web admin page aspx code: [Code].... web admin page code behind: [Code].... XmlSiteMapProvider code: [Code].... and finally, the web.config settings:[Code]....
Recently, I wrote code that dynamically builds a menu / navbar for my site that uses Reflection upon the [Authorize(Roles="")] attribute to determine what Controllers and ActionMethods should be shown to the user. And it came out really well. See this post for the details on how I did it: [URL]
The next step that I've been thinking about is when the user clicks on the "Controller" listing, it takes the user to the Index page. (eg. [URL] ) Which is perfectly fine, but I was thinking that it would be nice to also have this Index page for each controller dynamically constructed based on the user's roles / permissions. For example, if the Index page from XYZ-Controller might look like:
XYZ-Controller Index SomeMethod1 -- This method tweaks your widgets SomeMethod2 -- This method unwinds your widgets, re-orders thems, and then re-winds them, but only on Tuesdays. SomeMethod3 -- This method will delete some or all of your widgets and then you'll be sad.
I currently use Reflection to iterate thru all my Controllers and all the ActionMethods in each controller. I've been pondering the best way to store the Description of each ActionMethod. (Like, "This method tweaks your widgets.") Do I make my own Attribute called, say, Description which I would use to decorate ActionMethods with. For example it might look like this: [Description("This method tweaks your widgets")]
I changed my application to use "InProc" sessionState instead of "Off" because I need to preserve user selected language from page to page doing localization.n web.sitemap I have this line:
which before I changed sessionState to "InProc" worked as supposed to: menu item "Administrator" appeared as a menu choice only when user had logged in with admin rights. Now this menu choice is present for every user.
I am developing asp.net mobile application. I am using LINQ to XML to query XML file. I am using the following query to retrieve the name & value of the query dynamically as follows
var TotalManifolds = from MF in FieldRoot.Element("FIELD-DEFINITION").Element("MANIFOLDS").Elements("MANIFOLD") join SLT in FieldRoot.Element("FIELD-DEFINITION").Element("SLOTS").Elements("SLOT") on (string)MF.Attribute("MID") equals (string)SLT.Attribute("PARENT") select new { SlotName = (string)SLT.Attribute("NAME").Value, SlotValue = (string)SLT.Attribute("NAME").Value };
In the following statement of above query I want to retrive the name of the attribure dynamically without explicitly specifying the name of the attribute SlotName = (string)SLT.Attribute("NAME").Value Here I am explicitly specifying the name. I want to code which can dynamically retrieve the name of the attribute. I am new to Linq to xml. how this can be done programatically? or can you provide me the link through which I can resolve the above issue ?
I am trying to achieve a SSO implimentation across my websites so i am using the machine key attribute to do so.now the trouble starts here as the website the user logs in is on the .net 1.1 framework and the website it it navigating to is .net 4.0.I have share the same machine-key across both the application . It works fine in my testing environment but as i move to the deployment server ,it just dosent work !So what i could do is read this article on MSDN :
http://msdn.microsoft.com/en-us/library/eb0zx8fc.aspx this tells me to add a domin attribute like below <forms loginUrl="~Login.aspx" defaultUrl="Default.aspx" protection="All" timeout="80" name=".ASPXAuth" domain="asbc.com"/> but this thing just dosent work on the 1.1 application and throws an error Unrecognized attribute 'domain'.
Where do i get to mention the domin in my 1.1 application.?
I have one web.config in my website.Suppose i have a setting attribute as Righttoleft=false; in web.config file.I have a BasePage.cs all pages are derived from it.I am setting this Righttoleft=false; or true; programatically in Basepage.cs based on some condition and save it to web.config.I have a dropdown and based on the items selected from dropdown, for some items my web.config file saves with Righttoleft=false; and for some it saves with Righttoleft=true;
I was hoping some of you would entertain my XmlSiteMapProvider question. I have a portal site that has multiple ASP.NET Role Providers. One for each child web application. I need to basically change the role provider on the fly. Does anyone know if this is possible? My approach is to maybe override the XmlSiteMapProvider and add an attribute indicating which Role Provider to use. Then, in the IsAccessibleToUser method, I was planning on dynamically change the role provider some how based off the new attribute.
Again, is this approach seem reasonable/doable or am I in the weeds here? I'm open to alternatives if anyone has one.
I have a small windows forms application that uses the membership provider that is defined in my app.config file. I want to get rid of my app.config file and initialize the membership provider completely from code. The reason behind this is because I want to be able to dynamically connect to different databases containing asp.net user tables and I want the user to be able to enter the desired database information into a text box at run time. Is this possible or is it required that I have an app.config file?
I have a sitemap defined in a web.sitemap file and I'm also doing role-based authorization for locations using web.config. I'm using the web.sitemap to generate a menu structure on a Master page, and I wanted to somehow hook the role-based auth from web.config into my menu to hide links to pages that would be denied access from the roles auth.
Is it possible to read the list of <location path=""> and associated role authorizations (allow or deny) from web.config so I can check that against the web.sitemap when generating the menu structure?
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?
I am migrating from IIS6 to IIS7, and IIS6 was fine with this. I already made one change (system.web to system.webServer) and I don't know what's wrong with it now.