Skip to content
Loading
  • +1
    I have the control as input control and not ASP server control. So if I have to do server side validations then I have to do only in submit click and if it is done in submit click of the page then I have to call one single function (for ex: checkDOB) for nearly 10 calendar controls in a single page then that method will be called 10 times in submit click with the control object as input parameter. Can this be handled effectively?
    +1
  • Sachin Singh
    +1
    suppose there is a method
    1. public bool IsValidDate(DateTime date, string criteria)  
    2. {  
    3.  switch (criteria)  
    4. {  
    5.   case: "DOB" :  
    6.      if(date>DateTime.Now))  
    7.      {  
    8.     return true;  
    9.    }  
    10. return false;  
    11.    case: "OtherCase" :  
    12.     // handle accrordingly  
    13. }  
    14. }  
     Now you can call this method to validate all your criterias.
    +1