I have found an odd behavior from Validators and maskededitvalidators.
what I startted with is views and one view in particular had validators on it to test ffor dates within a text box and empty is valid.
However as I switched views I was getting the message error on page. I started with the maskededitvalidator and then changed it to a comparevalidator and both exibited the same behavior.
SO I changed from the view to seperate panels that I enable the visible when I want and I found I am getting same error so once again I changed to the Comparevalidator and I got the same behavior.
I know it is the validators as when I disable them the pages work perfrectly except I can't validate my date box any more.
I was wondering is there some work around or if I have some property set wrong I am showing the setup elow
To go where no programmer has gone before.
what I startted with is views and one view in particular had validators on it to test ffor dates within a text box and empty is valid.
However as I switched views I was getting the message error on page. I started with the maskededitvalidator and then changed it to a comparevalidator and both exibited the same behavior.
SO I changed from the view to seperate panels that I enable the visible when I want and I found I am getting same error so once again I changed to the Comparevalidator and I got the same behavior.
I know it is the validators as when I disable them the pages work perfrectly except I can't validate my date box any more.
I was wondering is there some work around or if I have some property set wrong I am showing the setup elow
Code:
<asp:textbox id="txtDateFrom" runat="server" Font-Bold="True" MaxLength="8" Columns="9"></asp:textbox>
<asp:ImageButton id="ImageButton5" runat="server" ImageUrl="~/Images/calendar.ico" Height="24px">
</asp:ImageButton>
<cc1:MaskedEditExtender id="MaskedEditExtender2" runat="server"
TargetControlID="txtDateFrom"
Mask="99/99/9999"
MaskType="Date"
MessageValidatorTip=true />
<cc1:MaskedEditValidator id="MaskedEditValidator2" runat="server" InvalidValueMessage="Please enter a correct date" Display="Dynamic" ControlToValidate="txtDateFrom" ControlExtender="MaskedEditExtender2" Enabled="False" >Please enter a correct date</cc1:MaskedEditValidator>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtDateFrom"
Display="Dynamic" ErrorMessage="Please Enter a correct date" Type="Date" Text="Please Enter a correct date" Operator="DataTypeCheck" />
<cc1:CalendarExtender id="CalendarExtender2" runat="server" TargetControlID="txtDateFrom" Format="MM/dd/yyyy" PopupButtonID="ImageButton5" BehaviorID="CalendarExtender2" />
To go where no programmer has gone before.