Question

I need to figure out a way to set ValidateRequest at model...I understand that I could set ValidateRequest to false at the web config level...but I don't want to do so at the application level, I rather prefer doing it at model level, in WebForms we used to have ValidateRequest page directive attribute which you could set to false, but in MVC we can do it at a controller level using "ValidateRequest = false"...but what I want to do is see if there is a way to apply this attribute at a model level....because I want to use the model in different places in my applications ...I don't want to set "ValidateRequest" everytime I use it in a view...

any help will be deeply appreciated...

Was it helpful?

Solution

the closest attribute I can think of is [AllowHtml] (under the System.Web.MVC) ...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top