Hi
I am having a DOB text box. This text box also allows to enter the date and also to pick the date using ajax CalendarExtender.
I used to set the dirty message when we edit some thing in the page.
when i enter some thing on the text box and click on the cancel button, dirty message will occur.
The problem i am facing is that, in Edit mode, I used to get all the records and assign to the text box. In that scenerio, the dirty message si automatically set since the DOB gets changes.
Please find the below code.
<asp:TextBox onkeyup="SetIsDirty();" TabIndex="4" onclick="ClearErrorMessage();" ID="txtEndDate" runat="server" CssClass="input-value"></asp:TextBox>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtEndDate" Mask="99/99/9999" MaskType="Date"> </ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="imgbtnDOB2" TargetControlID="txtEndDate">
</ajax:CalendarExtender>
<asp:ImageButton runat="server" ID="imgbtnDOB2" Width="18px" Height="17px" ImageUrl="~/Images/date-img.gif" />
<asp:RequiredFieldValidator runat="server" Text="*" SetFocusOnError="True" ID="RequiredFieldValidator2" ValidationGroup="vgProductDetails" ControlToValidate="txtEndDate"></asp:RequiredFieldValidator>