SharePoint: A potentially dangerous Request.Form value was detected from the client

Recently, while working on a few new web parts, I encountered an issue with adding these web parts to a page.  I started getting the following error:

A potentially dangerous Request.Form value was detected from the client (ctl00$PlaceHolder1$ctl00$ctl00$RichHtmlField="<P align=center>
<P...").

I tried removing other web parts and content from the page but it resulted in the same error message pointing to a different control.

It turns out that while working on getting the .NET 3.5 working with MOSS 2007, I lost a section of the web.config:

WinMerge Web.config

<pages enableSessionState="false" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">
  <namespaces>
    <remove namespace="System.Web.UI.WebControls.WebParts" />
  </namespaces>      
  <tagMapping>
    <add tagType="System.Web.UI.WebControls.SqlDataSource, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mappedTagType="Microsoft.SharePoint.WebControls.SPSqlDataSource, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
  </tagMapping>    
</pages>

Once this XML section was restored back into the web application’s web.config the error went away.


Feedback

# re: SharePoint: A potentially dangerous Request.Form value was detected from the client

THANK YOU! This is such an odd resolution. I'm actually really surprised that it worked. The error that we were getting was when trying to add users to a site collection. Every time you would hit the search button or click the check userid button the system would just sit there and spin. I added the section of the web.config that you specified and everything works fine.

Thanks again! 1/7/2010 8:45 AM | Stewart

# re: SharePoint: A potentially dangerous Request.Form value was detected from the client

Glad it helped. Thanks for letting us know. 1/7/2010 9:15 AM | blogadmin

# re: SharePoint: A potentially dangerous Request.Form value was detected from the client

Any idea why that section of the web.config might just disappear like that? 1/12/2010 4:22 AM | Stewart

# re: SharePoint: A potentially dangerous Request.Form value was detected from the client

In my case it might have been something I did to try to fix the problem. I find that it is a good idea to backup a copy of the web.config file to a location other than the virtual directory root. 1/12/2010 7:33 AM | blogadmin

Post a comment





 

Please add 4 and 2 and type the answer here: