validation - ASP.NET MVC ValidateInput(false) stops working with xVal and [RegularExpression] DataAnnotation -


I "& lt;" Characters in the form field by the Rezeks Vedicker I will describe this problem in 3 steps:

Step 1 : When I say "& lt;" To avoid the expectation of ASP.NET, I receive a "potentially dangerous request ..." to decorate my updated method - as expected in ASP.NET .

Step 2 with "[ValidateInput (false)]" in the controller

This works as expected - I now use the "& lt;" I can post without error characters.

Step 3 : I use xVal with DataAnotation. For example, [required] or [string length (255)] works as expected

But when I use it: [Regular expression ("^ [ ^ & Lt;>] * $ ", error message =" special characters are not allowed ".]], .

What's going on? Is there an easy way to regex validaton, but with [ValidateInput (false)] in place? Undoubtedly, I'm in the model I want to code my verification, not in the controller.

No, this MVC 1 + There was an issue in xVal.It is believed in MVC2 that it works (and then there is no need for xVal) - Alex 42

It seems that the bot is one of the top But still persists on pushing. Are you accepted as answer as it knows?


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -