webforms - validateRequest=true and requestValidationMode="4.0" lets html through -
I have a web form website on IIS7 and .NET 4.5.1 and I want Microsoft's request recognition. The web.config default value for Valid.request and requestValidationMode is considered "true" and "4.0" respectively and this should be what I want (I have tried to specify them).
& lt; Confirm valid pages = "true" & gt; & Lt; HttpRuntime requestValidationMode = "4.0" />
For some reason, when I am trying to submit an HTML tag (tried & lt; script> and & lt; a>) in a form, I hope The potentially dangerous request error, but the tag is saved in the database. Why did it go through? I just take the text value of the text box and send it to my DB, but I hope there will be an error to stop it from happening.
When I tried the setting:
& lt; HttpRuntime requestValidationMode = "2.0" />
The error was the same, but this time, the tag did not end in the database, which I want.
I would like to understand why the less secure recognition mode "2.0" is the only one which actually prevents the request from going into my case, which does not make much sense. I am missing something, please tell me whether I have to provide other information.
I have found a solution to your problem, it will appear that all the values above "4.0" "4.0" is interpreted as, but this is not true. Reading, I have come to know that "4.5" is fair and just does what I wanted.
Comments
Post a Comment