Calendar Required Field Problem?
Hellos;
i want to validate the Calendar.SelectedDate in FormView Panel (asp.net auto insert, update,delete forms)
because if Calendar.SelectedDate is nothing it inserts db NULL however i want to insert Today Date inside of
null value. In the Page_Load you can't reach any control of the FormView. How can i achnieve this big problem.
Thanks a lot ...
[402 byte] By [
gokce] at [2007-12-25]
Here is how to validate the date input.
<asp:RegularExpressionValidatorID="RegularExpressionValidator15"runat="server" ControlToValidate="txtDate"ErrorMessage=" * Invalid" Font-Names="Tahoma"Font-Size="10px"ValidationExpression="([1-9]|0[1-9]|1[012])/([1-9]|0[1-9]|[12][0-9]|3[01])/20[0-9][0-9]"Display="Dynamic"SetFocusOnError="True"></asp:RegularExpressionValidator>
<
asp:
RequiredFieldValidatorID="RequiredFieldValidator7"runat="server"ControlToValidate="txtDate" Display="Dynamic"ErrorMessage="* Required"Font-Names="Tahoma"Font-Size="10px"SetFocusOnError="True"></
asp:
RequiredFieldValidator>
to set the date textbox to today date :
txtDate.Text = DateTime.Today.ToString("MM/dd/yyyy");