Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 24, 2012 07:33 AM by Angie xu - MSFT
Dec 18, 2012 02:32 PM|LINK
We are facing an strange error like 'A potentially dangerous Request.Form value was detected from the client ()' in our application .Actually we
had migrated our code from 3.5 to 4.0 , after migrating only, we are facing the issue. As I read some of the articles for issue in that they were
suggesting to go for change in web.config like ' <httpRuntime requestValidationMode="2.0"
' but here my question is we have disabled the
Page level http request validation to false in our page for 4.0 Framework without changing the requestValidationMode to
2.0 but it is not
working.Here my requriment is like we are not ready to change the requestValidationMode to 2.0 in web.config file because we need validate
the webservice request and ajax requests as such as in 4.0 framework but we need to validate or not in particular pages as per the business
logic .So how do we do this is in 4.0 framework.
Dec 24, 2012 07:33 AM|LINK
It seems that if you set <httpRuntime requestValidationMode="2.0"/>,
and then the error 'A potentially dangerous Request.Form value was detected from the client ()' will be fixed. But you don't want to do that and use .NET 4.0 framework.
I think you have two options below:
1) The .NET Framework 4 is highly compatible with applications that are built with earlier .NET Framework versions, except for some changes that were made to improve security, standards compliance, correctness, reliability, and performance, .net 3.5 codes
work in .net 4.0.
The .NET Framework 4 does not automatically use its version of the common language runtime to run applications that are built with earlier versions of the .NET Framework. To run older applications with .NET Framework 4, you must compile your application
with the target .NET Framework version specified in the properties for your project in Visual Studio, or you can specify the supported runtime with the
<supportedRuntime> Element in an application configuration file.
2) You should check whether you migrate your project from .NET 3.5 to .NET 4.0 properly, you could follow the Migration Guide to the .NET Framework 4 below:
hope it helps you,