locked
Problem Removing Date From Textbox w/ MaskedEdit and CalendarExtender RRS feed

  • Question

  • User553440649 posted

    Working on an existing project that's passed through several hands. Several pages have fields set up like:

     <td align="left" colspan="5">
                    <asp:TextBox ID="txtDD1AppDate" runat="server" />
                    <asp:image ID="imgDD1AppDate" runat="server" imageUrl="~/App_Themes/Theme1/img/calendar_add.png" />
                    <ajaxToolkit:CalendarExtender ID="DD1AppDateCalendarExtender" format="MM/dd/yyyy" runat="server" TargetControlID="txtDD1AppDate" PopupButtonID="imgDD1AppDate" />
                    <ajaxToolkit:MaskedEditExtender ID="DD1AppDateMaskedEditExtender" runat="server" Mask="99/99/9999" MaskType="Date" TargetControlID="txtDD1AppDate" PromptCharacter="_"/>
                </td>

    As far as I tell there should be no problem with removing a date from the textbox. However, when I do so, the current date is inserted. The contents of the control cannot be removed. There is a RequiredFieldValidator on it, but I can't see how that would be doing this:

    <asp:RequiredFieldValidator ID="rfvDD1App" runat="server" ErrorMessage="DD1 Application Date is required." ControlToValidate="txtDD1AppDate" Display="None"/>

    Nothing in the code behind touches the textbox contents that I can see. 

    Anyone know if any of the controls attached to the textbox could be causing this behavior? I've created a new project with a textbox and the controls attached, but don't get the same behavior. :\

    Friday, February 28, 2014 9:21 AM

Answers

  • User-1716253493 posted

    Make sure the button CausesValidation property is not false

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 1, 2014 12:07 AM