Custom validation error message RRS feed

  • Question

  • User-1453407501 posted

    How can I change the default field template error message to something more generic. Currently I get 'Cannot convert value of parameter 'EnteredService' from 'System.String' to 'System.DateTime'.

    Thursday, December 18, 2008 4:33 PM

All replies

  • User-503911561 posted

     can you be more specific?

    Thursday, December 18, 2008 6:09 PM
  • User-1453407501 posted

    Sorry, I'm trying to display a simple 'Invalid Date' message when the entered text is not convertable to a DateTime. Currently it appears as tho the DynamicValidator in the DateTime_Edit.ascx is catching the exception thrown from linq and displaying 'Cannot convert value...'. I'd like to know how to intercept this and return back a more user friendly error message. I'd rather not implement a regex validation attribute since it wouldn't be culture neutral.

    Thursday, December 18, 2008 6:16 PM
  • User-330204900 posted

    You could use a CustomValidator and then have some server side code to do the validation setting the vslidateors property IsValid to false

    Thursday, December 18, 2008 6:28 PM