Dipa Ahuja

Dipa Ahuja

  • NA
  • 3.3k
  • 711.5k

date validation

Feb 15 2010 1:15 PM

Hello.. i have use the compare validator to validate the date...

<
tr>
<%
-- Birthdate --%>
<
td align="right" style="width: 156px">
<
asp:Label ID="lblbdate" Text="Birthdate(dd/mm/yyyy)" runat="server"></td>
<
td>
<asp:TextBox runat="server" ID="txtbdate" autocomplete="true" /><br /> 
<asp:CompareValidator ID="cmpbdate" runat="server" ControlToValidate="txtbdate" ErrorMessage="Invalid Date" Operator="DataTypeCheck" Text="#" Type="Date" Font-Size="Smaller"/>

<cc1:CalendarExtender ID="defaultCalendarExtender" runat="server"
TargetControlID="txtbdate" DaysModeTitleFormat="dd MMMM,YYYY" TodaysDateFormat="dd/MM/ yyyy" DefaultView="Years" />
</td>
</
tr>

but it use the format dd/mm/yyyy.. and when we select date from ajax CalendarExtender that enter date in mm/dd/yyyy format...
 
so how to change date format of either comare validator.. or ajax CalendarExtender

Answers (2)