WebConfigurationManager Error After Adding SiteMap?

May 16, 2010

I'm getting this error:

Compiler Error Message: CS0118: 'Configuration' is a 'namespace' but is used like a 'type'
Configuration myWebConfig = WebConfigurationManager.OpenWebConfiguration("~/");

This code has been in place for 5+ months without this issues, only today after adding this sitemap code do I have this issue.

<siteMap defaultProvider="ExtendedSiteMapProvider" enabled="true">
<providers>
<clear/>
<add name="ExtendedSiteMapProvider" type="Configuration.ExtendedSiteMapProvider" siteMapFile="Web.sitemap" securityTrimmingEnabled="true"/>
</providers>
</siteMap>

I tried adding "System.Web." before the "Configuration ", but that did not work either:

System.Web.Configuration myWebConfig = WebConfigurationManager.OpenWebConfiguration("~/");

Error 1 'System.Web.Configuration' is a 'namespace' but is used like a 'type'

View 2 Replies


Similar Messages:

Web Forms :: Parser Error Message - XML Sitemap Config File Web.sitemap Could Not Be Loaded

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

C# - Adding A .ASCX Item To The Sitemap?

Aug 23, 2010

Is there a way to add .ascx files to a sitemap such that it will load/unload the controls based on the last ones visited? The problem is i have a page that contains a few controls that get placed under one another, and i'd like to just be able to jump between them with the sitemap instead of creating a new page for them... this is what i'm trying to put into the sitemap without luck (see Product List, Product Detail):

<siteMapNode url="Default.aspx" title="Home" description="Home Page of Genuity">
<siteMapNode url="UserFunctions/ChangePassword.aspx" title="Change Password" description="Change Password" />
<siteMapNode url="Setup/EditUsers.aspx" title="Edit Users" description="Edit Users" />
<siteMapNode url="Setup/EditTraits.aspx" title="Edit Traits" description="Edit Traits" />
<siteMapNode url="DataEntry/EditSeedPartners.aspx" title="Seed Partners" description="Seed Partners">
<siteMapNode url="WebControls/Product List.ascx" title="Product List" description="Product List" >
<siteMapNode url="WebControls/ProductDetail.ascx" title="Product Detail" description="Product Detail" />
</siteMapNode>
</siteMapNode>
</siteMapNode>

View 1 Replies

Web Forms :: Exception Comes After Adding Web.sitemap File

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

Adding An Internal ASPX Page With Relative URL To CRM 4.0 Sitemap

Feb 8, 2011

I've added a subarea to my sitemap in CRM 4.0, and for absolute URLs it works as expected. However, for relative URLs it does not. The page in question is internal and is accessed through:

http://localhost/ISV/<orgName>/Account.aspx/ExternalDocumentList

However, I would prefer writing this in sitemap:

/ISV/<orgName>/Account.aspx/ExternalDocumentList

When this is expanded, CRM/IIS rewrites it to:

http://localhost/<orgName>/ISV/<orgName>/Account.aspx/ExternalDocumentList

For reference, here is the sitemap addition (which doesn't work):

<SubArea Id="custom_documentHistory" Url="/ISV/<orgName>/Account.aspx/ExternalDocumentList">
<Titles>
<Title LCID="1033" Title="Document History"/>
</Titles>
</SubArea>

How can I link to this page relatively?

View 1 Replies

Web Forms :: Adding A Virtual Folder Into Sitemap Generated URLs?

Feb 15, 2010

I'm not sure that what I need to do is possible.I'm using the SQL SiteMap Provider as the source for my main navigation menu. When a user hits my site, they are asked to enter their location (town name). This preference setting is being stored using the Profile Provider. The page then reloads to showwww.mysite.com/liverpool in the address bar, for example. The information shown on this page is relevant to where they are. I'm using URL rewriting to map this to a page that is passed a parameter (eg. viewZone.aspx?ZoneID=234). I now need to insert the town name into some of the URLs generated from the sitemap. For example:www.mysite.com/cars-for-salewould becomewww.mysite.com/liverpool/cars-for-saleSome URLs would need to remain unchanged such as www.mysite.com/shop.Do you know if this is possible? If needed I could put a placeholder inside the URL in the database - **townName**/cars-for-sale and then run some kind of replacement procedure at run-time, but I don't know where in the execution process I could do that.

View 5 Replies

HttpRuntime.Cache Getting Flushed When Saving WebConfigurationManager - Is This A Bug

Oct 19, 2010

I've been experimenting with caching objects with HttpRuntime.Cache and I was generally under the impression that if I "added" something to the cache like this:

HttpRuntime.Cache.Insert("Test", "This is a test!", null,
Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
CacheItemPriority.NotRemovable, new CacheItemRemovedCallback(FileChanged));

that the "NotRemovable" and "NoExpiration" flags would keep the object in-memory for the duration of the application. But was finding that at the end of certain page requests, the HttpRuntime.Cache would be completely empty!

Tracing thru and setting a breakpoint inside my Callback "FileChanged" I could see that indeed something was "removing" my object (and every other object in the cache), but I couldn't figure out why. So eventually, I started disabling other things that I thought might affect this subsystem.

Eventually, I commented out the line:

WebConfigurationManager.OpenWebConfiguration("~").Save;

I had been mostly retrieving data from "web.config" in the AppSettings region, but occasionally writing back to AppSettings and saving the changes using the above command. I knew from reading that the "web.config" is cached, but saving my changes back to it shouldn't flush all of HttpRuntime.Cache, right?

EDIT:

I've made this super reproducible if wants to try this on their own machine. (I'm running VS2008 Pro w/ MVC2 targeting .NET 3.5) Just start up a new MVC2 project and paste the following into the HomeController over whatever is already there:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Configuration;
using System.Configuration;........

Start-up the app in debug mode. Click on the "About" link. This loads a string into the Cache. Click on the "Home" link. String is pulled from the Cache and stuck in ViewMessage dictionary. Some key/value pair is written to web.config and saved. String from cache should appear on the Home page. Click on the "Home" link again. String should be pulled from the cache, but it's not. Stop program. Comment out the 3 lines that start with "Config". Restart the program. Try steps 1 thru 4 again. Notice how the HttpRuntime.Cache has not been emptied.

View 1 Replies

Use WebConfigurationManager To Get Section From Specific Config File?

May 14, 2010

I am trying to get sections from specific .config file such like "my.config".
WebConfigurationManager.OpenWebConfiguration can get the web.config in specific path.
Maybe WebConfigurationManager.OpenMappedWebConfiguration can reach my purpose

View 2 Replies

C# - Caching Of WebConfigurationManager.AppSettings - Read From Disk Each Time?

Nov 28, 2010

I have a lot of requests that read my Web Config file (eg. variable = WebConfigurationManager.AppSettings["BLAH"]). I am wondering... Do WebConfigurationManager.AppSettings read from disk each time, or is it cached in memory. If it's read from disk each time then I guess I will need to move the variable to a static variable so as to improve my app performance...

View 1 Replies

Sitemap Randomly Breaks Over Time / Could Not Find The Sitemap Node With URL '~/Default.aspx'

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

SiteMap Change SiteMapProvider / Create Multiple Web.sitemap Files?

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

Web Forms :: Error. The File Web.sitemap Required By XmlSiteMapProvider Does Not Exist?

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

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

Web Forms :: Programmatically Reference .sitemap File That Isn't The Root Web.sitemap File?

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

Web Forms :: Sitemap Node - Seond Line Of Sitemap Node Won't Indent?

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

Retrieving Configuration Sections Through WebConfigurationManager And Configuration Objects?

Jan 30, 2010

We can retrieve configuration sections from web.config in the following two ways:
Configuration config = WebConfigurationManager.OpenWebConfiguration("/");
AuthenticationSection authSection = (AuthenticationSection)
config.GetSection(@"system.web/authentication");

[code]...

View 1 Replies

Web Forms :: Error - Could Not Find The Sitemap Node With URL 'Menu1.aspx?node=hardware'

Dec 8, 2010

Is it possible to have >1 sitemap files so that I can separate section 1 and 2 into two separate sitemap files?

The codes give this error:

Could not find the sitemap node with URL 'Menu1.aspx?node=hardware'.

The .aspx file has:

[Code]....

The Web.sitemap file contains:

[Code]....

[Code]....

View 6 Replies

Custom Server Controls :: Custom Control Design Time SiteMap Provider Error?

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

MVC :: After Adding Routing, Receive Error 404?

Feb 10, 2011

i have a working mvc web site (MVC 2)and im tring to add routingso i changed the index this waypublic ActionResult Index(string id)and call to the same url with this addition /1i receive 404 (and try to redirect to defualt.aspx )i have tried few changes on the web.config

View 19 Replies

Getting Ajax Error While Adding 3.5 Web App To Existing 2.0 Websites?

Jul 23, 2010

I have web site with Dotnet 2.0 framework With Ajax1.0. Now My requirement is to add Web Application built in 3.5 framework not used Ajax at all. But I am getting Ajax Error

[Code]....

View 1 Replies

Error - Membership Provider When Adding User

Nov 17, 2010

The error message below i get when I"m trying to create a new user in a project management system we use for a client. I type in all the corresponding information then when I click create it throws this error.

invocation. at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Administration.WebAdminMembershipProvider.CallWebAdminMembershipProviderHelperMethodOutParams(String methodName, Object[] parameters, Type[] paramTypes) at System.Web.Administration.WebAdminMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

View 2 Replies

WCF / ASMX :: Getting Error On Adding Service Reference?

Aug 25, 2010

I am getting this error while loading(adding) it into service References (web client)

The type 'WcfTrial2.Calculation', provided as the Service attribute value in the ServiceHost directive could not be found.

How to resolve it?

View 1 Replies

AJAX :: Error When Adding Handlers At Runtime

Jan 15, 2010

I have have two radio button lists that need to be mutally exculisve, i.e when one is clicked the other one neesd to be cleared, my further problem is beause they are in a formview I had to add handlers to clear all the controls in the other list when the one is clicked and vice versa. here is the code below Now the code works but one of the testers found that if you click back and forth around twenty times you get the above java error:

Exception message: Maximum request length exceeded

my though here is the handler is being added to many times ? but even if I remove the handler after the process is complete I still get the same error.

[Code]....

View 2 Replies

WCF / ASMX :: Error While Adding Pollingduplex Binding?

Aug 20, 2010

I am making samle of polling duplex in .net 4.0

when ever i put binding this tag in web.config it shows error.

<bindings>
<pollingDuplexHttpBinding/>
</bindings>

Warning 1 The element 'bindings' has invalid child element 'pollingDuplexHttpBinding'. List of possible elements expected: 'basicHttpBinding, customBinding, msmqIntegrationBinding, netPeerTcpBinding, netMsmqBinding, netNamedPipeBinding, netTcpBinding,
wsFederationHttpBinding, ws2007FederationHttpBinding, wsHttpBinding, ws2007HttpBinding, wsDualHttpBinding, netTcpContextBinding, wsHttpContextBinding, basicHttpContextBinding, mexHttpBinding, mexHttpsBinding, mexNamedPipeBinding, mexTcpBinding, webHttpBinding'.
D:DuplexTestTestPollingDuplexWcfTestPollingDuplexWcfTestPollingDuplexWcfWeb.config 9 8 TestPollingDuplexWcf

View 3 Replies

C# - Adding KnownType Attribute Causes Unknown Error?

Jun 21, 2010

I'm using DataContract/DataMembers to serialise my class to JSON for a webservice, and it all works fine, except for one of my members, which could either be class a, or class b, where class b extends class a.

If I omit the KnownType parameter, then an exception is thrown during serialisation:

Type 'ClassB' with data contract name 'ClassB:http://schemas.datacontract.org/2004/07/MyApp.App_Code' is not expected.

As expected, because the ClassB is an extension of Class A, and so not know to the deserialiser. So I need to add a known type attribute, which I do, to the parent Class which contains the member

[KnownType(typeof(ClassB))]
[DataContract]

This compiles fine, but the page which I am currently testing this on seems to go bizzare, it loads fine, however apparently the Service doesn't exist anymore, as my JS call tells me and throws and error. But I have no idea why adding the known type attribute on my class causes the webservice to apparently not exist :s

Is it something to do with the fact that my setup is ClassA, ClassB: ClassA, and all the examples I have seen, seem show a ClassA: ParentClass, ClassB: ParentClass setup.

.NET 4, VWD 2010express

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved