Last post Jun 15, 2013 06:04 AM by CriticalError
Jun 14, 2013 04:34 PM|CriticalError|LINK
Why is the Validaiton methods such as Add, AddForm error not available in a helpers?
Jun 14, 2013 06:05 PM|Mikesdotnetting|LINK
No sure what you mean, but you can use ModelState.AddFormError() even though you are using the Validation helpers from Web Pages 2. In fact, you probably need to if you want to validate data outside of Request.Form, such as Request.Files data or stuff in
the query string.
Jun 14, 2013 07:09 PM|CriticalError|LINK
In a helper if I type Validation the property does not show in intellisense and if I type Validation.Add I get this:
'System.Web.Helpers.Validation' does not contain a definition for 'Add'
Only the class Validation is available in helpers. How come?
Jun 15, 2013 04:46 AM|Mikesdotnetting|LINK
Oh - I see what you mean. No - the WebPages.ValidationHelper class is not available to files place in App_Code. You can use it in a helper, so long as that helper is declared in a cshtml file that is not placed in App_Code.
Jun 15, 2013 06:04 AM|CriticalError|LINK
Why is this? I find it very strange..