I trying to assign a string of the following type to a string variable in C#. I have looked at [ValidateInput(false)]
attribute but it disables validation for all the variables for the method it is used on. I just want it for one variable in the method.
<A HREF="http://www.google.com">
But I'm getting the following exception when running this code.
A potentially dangerous Request.QueryString value was detected from the client (mystr="<A HREF="http://www...").
I'm assigning like
mystr = Request.QueryString["content"]
Kindly help we how to fix this. I have tried writing [AllowHtml]
tag above the variable declaration. My string variable is a part of the model which is defined in Models.
EDIT:
Thanks to CodeCaster, I accept this as my answer.