I have two labels and two text boxes, a Compare validator and a button.
I need it to compare two dates (rental date , return date ) and when the rental date is less or equal to return date are the same. No validation message.
While when when the rental date is less than the return date, display an input error message.
The compare validator has been set with :
controltocompare : txtrental,
controltovalidate: txtreturndate,
operator :greater than equal,
type:date,
errormessage: return date must be greater or equal than rental date,
I am not sure how to get the btn to display it ?
Create a method to display message.
private void AlertBox(string Msg) { string s = "alert('" + Msg + "')"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ckey", s, true); }
find the code to validate and throw alert message.
If you find it useful, please mark it as your answer else let me know...