Monday, 15 February 2010

c# - How to return custom error message to View? -


I have created a Datasheet class, which returns an error if the selected date is in the past:

  Public category validated category: verification entry {public date time first date = date time today; // Get Public Datetime Secondend {Receive; Set; } Private contact string DefaultIncorrectDateMessage = "The date you entered is incorrect, please try again"; Public String Date InPastMessage {get; Set; } // Public String DateNote Orange Message {get; Set; } Protected Override Validation Result IsValid (Object Value, Validation Contact Validation Contact) {// Your Verification Logic If (Convert. DateTime (Value)> Date = Time Today) {Return Validation Results. Success; } And {new verification return (date input message ?? default incarnated date date message); }}}  

This is my view:

  [validated category (date inmemberm = "Your date is in the past. Select! ")] [Datatype (datatype.det)] Public Date Time Arrival Date {Received; Set; }  

This works correctly, though DateInPastMessage is now back in the form of a debug message, when the application fails on db.SaveChanges () is.

I want to see this message as a normal error message:

Enter image details here

How can I send my favorite error message to see? Can this be done without creating a custom jquery verification in each scene where I have a datepayer field?

You must error message in verification entry set on. I do not think that's why I do not see it.

  error message = default uncheck date messages;  

No comments:

Post a Comment