User475983607 posted
jsshivalik
how to input date using jquery datepicker in dd-mm-yyyy and save in sql using c# . In Sql i have DataType Date of a field.
Your other thread shows that you already know how to format the date when the user makes a selection from the calendar.
https://forums.asp.net/p/2157770/6270384.aspx?Input+string+is+not+in+correct+format
The format is not working?
If you are trying to force the user to enter a specific date when using the keyboard, then use standard ASP Validation controls.
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1"
runat="server"
ErrorMessage="RegularExpressionValidator"
ControlToValidate="TextBox1"
ValidationExpression="^([0-2][0-9]|(3)[0-1])(-)(((0)[0-9])|((1)[0-2]))(-)\d{4}$"></asp:RegularExpressionValidator>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>