locked
MaskedEditExtender error RRS feed

  • Question

  • User714838281 posted

    Hi.

    I have this code

    <asp:MaskedEditExtender runat="server" TargetControlID="tb_time" ID="meeHoraChegada"
         MaskType="Time" Mask="99:99" AutoComplete="false">
    </asp:MaskedEditExtender>
    <asp:MaskedEditValidator ID="MaskedEditValidator2"  runat="server"
         ControlExtender="meeHoraChegada" ControlToValidate="tb_time"
         IsValidEmpty="True"
         InvalidValueMessage="The Time is not valid!"> 
    </asp:MaskedEditValidator> 

    When i start to enter the time, where i press a key it fill's the hour with the twice os the key value and in the next key press i get the same number twice.

    For example i press 1 the hour stays with 11 and where i press the second digit value 3 i get 33 the result will be 11:33....

    if i press 2 and 5 i get 22:55...

    Any idea?

    Monday, August 10, 2015 11:23 AM

Answers

  • User1724605321 posted

    Hi marcobranco ,

    For example i press 1 the hour stays with 11 and where i press the second digit value 3 i get 33 the result will be 11:33....

    I test your code and it works fine in my local environment , tested code is for your reference:

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
      <asp:TextBox ID="tb_time" runat="server" Width="130px" Height="16px"  />
                <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server"
                    TargetControlID="tb_time"
                    Mask="99:99"      
                    MaskType="Time"
                    AutoComplete="false"
                   />
                <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
                    ControlExtender="MaskedEditExtender1"
                    ControlToValidate="tb_time"
                    IsValidEmpty="True"       
                    InvalidValueMessage="Time is invalid"             
                     />

    You could also refer to link below for more information about MaskedEdit control:

    http://ajaxcontroltoolkit.com/MaskedEdit/MaskedEdit.aspx .

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 11, 2015 2:00 AM