RadDatePicker Invalid Date Alert Box

There is no validator in .net that validate raddatepicker's invalid date. in this case we should use raddatepicker's client event on error.

<telerik:RadDatePicker  runat="server" ID="rdpStartDate">
           <DateInput runat="server">
               <ClientEvents OnError="ValidateDate" />
           </DateInput>
       </telerik:RadDatePicker>

JavaScript

function ValidateDate(sender,args)
{
           var reason = args.get_reason();

           if (reason === 1) 
           {
                alert("Invalid Date");
           }

           if (reason === 2)
           {
               alert("The Date you have typed is out of range");
           }
}




Comments

Popular posts from this blog

C# Copy files from one server to another

Export SharePoint Online Group Users to Excel using Powershell