error on EditPage

Jun 1, 2012 at 2:31 PM

I'm very new to this and have installed razorc and got the admin page working but I get this error when i click update on edit page. This happens even when no changes have been made. Using windows 7. What's recomended to fix this?


Server Error in '/' Application.

A potentially dangerous Request.Form value was detected from the client (pText="<p> CMS - ...").

Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. To allow pages to override application request validation settings, set the requestValidationMode attribute in the httpRuntime configuration section to requestValidationMode="2.0". Example: <httpRuntime requestValidationMode="2.0" />. After setting this value, you can then disable request validation by setting validateRequest="false" in the Page directive or in the <pages> configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. For more information, see

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (pText="<p> CMS - ...").

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>


2) Add the following section to the configuration file of your application:

<compilation debug="true"/>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (pText="<p> CMS - ...").]
   System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +322
   Microsoft.Web.Infrastructure.DynamicValidationHelper.<>c__DisplayClass12.<ReplaceCollection>b__d(String value, String key) +77
   Microsoft.Web.Infrastructure.DynamicValidationHelper.LazilyEvaluatedNameObjectEntry.ValidateObject() +89
   Microsoft.Web.Infrastructure.DynamicValidationHelper.LazilyValidatingArrayList.get_Item(Int32 index) +55
   System.Collections.Specialized.NameObjectKeysEnumerator.get_Current() +56
   RazorDebugger.DebuggerService.Initialize(WebPageRenderingBase page) +196
   ASP._Page_rcadmin__PageStart_cshtml.Execute() in c:\Users\steve\AppData\Local\Temp\Temporary ASP.NET Files\root\e761f4a2\72100704\App_Web_blue4dez.5.cs:0
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +48
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context) +239

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

<!-- [HttpRequestValidationException]: A potentially dangerous Request.Form value was detected from the client (pText="<p> CMS - ..."). at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) at Microsoft.Web.Infrastructure.DynamicValidationHelper.ValidationUtility.CollectionReplacer.<>c__DisplayClass12.<ReplaceCollection>b__d(String value, String key) at Microsoft.Web.Infrastructure.DynamicValidationHelper.LazilyEvaluatedNameObjectEntry.ValidateObject() at Microsoft.Web.Infrastructure.DynamicValidationHelper.LazilyValidatingArrayList.get_Item(Int32 index) at System.Collections.Specialized.NameObjectCollectionBase.NameObjectKeysEnumerator.get_Current() at RazorDebugger.DebuggerService.Initialize(WebPageRenderingBase page) at ASP._Page_rcadmin__PageStart_cshtml.Execute() in c:\Users\steve\AppData\Local\Temp\Temporary ASP.NET Files\root\e761f4a2\72100704\App_Web_blue4dez.5.cs:line 0 at System.Web.WebPages.StartPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.WebPages.WebPageHttpHandler.HandleError(Exception e) at System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context) at System.Web.WebPages.WebPageHttpHandler.<>c__DisplayClass1.<ProcessRequest>b__0() at System.Web.WebPages.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) at System.Web.WebPages.SecurityUtil.ProcessInApplicationTrust(Action action) at System.Web.WebPages.WebPageHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->
Jun 1, 2012 at 2:55 PM

1) Did you make any changes to website/code ? Original code uses

pText = Request.Unvalidated("pText"


so you should not see this error...

So is this a clean instalation or you did some changes, to web.config, pages ?

2) i just tested both version that are available for download one on microsoft's web site and one here on codeplex and both works fine on win 7

Jun 1, 2012 at 3:07 PM

I downloaded it today via webMatrix with no changes made except adding some modules I was curious about (like paypalhelper) but a clean install.

Jun 1, 2012 at 4:43 PM

1) what version of webmatrix do you use ??? - the beta one ?

2) can you please install it again and test without adding any modules


Jun 1, 2012 at 5:52 PM

I've installed it again with no modules and it works fine. Sorry for wasting your time on this.

Can you point me to which file holds this footer?

<!-- end #page -->
Jun 1, 2012 at 5:59 PM
Edited Jun 1, 2012 at 6:00 PM

1) Good. I just tested it with PayPal helper and works just fine....

2) under rcLayouts you will find files ex. _rcCupOfCoffe.cshtml - that is the layout page. BTW "(c) 2012 localhost" will change to your domain name on live site