Validating the dates
-
I have a textBox Where I type date. I want to validate it. Im using customValidate controls. I have this function in my code behind page void DatesValidate(object source, ServerValidateEventArgs e) { if (Convert.ToDateTime(e.Value) <= DateTime.Now) { e.IsValid = false; this.lblAddUsers.Text = "The Proxy is already expired"; } } It is not working it is giving the follo2ing error 'Proxy.DatesValidate(object, System.Web.UI.WebControls.ServerValidateEventArgs)' is inaccessible due to its protection level
seema
-
I have a textBox Where I type date. I want to validate it. Im using customValidate controls. I have this function in my code behind page void DatesValidate(object source, ServerValidateEventArgs e) { if (Convert.ToDateTime(e.Value) <= DateTime.Now) { e.IsValid = false; this.lblAddUsers.Text = "The Proxy is already expired"; } } It is not working it is giving the follo2ing error 'Proxy.DatesValidate(object, System.Web.UI.WebControls.ServerValidateEventArgs)' is inaccessible due to its protection level
seema
Use the
protected
access modifier in front of the method declaration. By default, methods are private when specified without an access modifier.Jon Sagara Once again, the conservative sandwich-heavy portfolio pays off for the hungry investor! *slurp* Oh, I'm ruined! -- Dr. Zoidberg .NET Blog | Personal Blog | Articles