locked
Cannot get a reference to TextBox from NumericUpDownExtender when inside another element RRS feed

  • Question

  • User1909155429 posted
      


    <fieldset style="float:left;text-align:left;width:230px;"> <asp:TextBox ID="TxtNectarPoints" runat="server" ></asp:TextBox> <ajaxToolkit:NumericUpDownExtender ID="NumericUpDownExtender1" runat="server" Maximum="100" Minimum="0" Step="5"
    TargetControlID="TxtNectarPoints" Width="50" > </ajaxToolkit:NumericUpDownExtender> </fieldset>

    I can get it to work once I take it out of the FieldSet element for example. In practice it is placed inside a ModalPopupExtender control.

    This example is to verify whether it was inoperable inside other  Html elements besides a Ajax control.

     

     

    Wednesday, December 16, 2015 12:11 AM

Answers

  • User61956409 posted

    Hi peterthegreat,

    I can get it to work once I take it out of the FieldSet element for example. In practice it is placed inside a ModalPopupExtender control.

    I create the following sample to reproduce your problem, NumericUpDownExtender works fine in modal popup.

    <asp:Button ID="Button1" runat="server" Text="ShowModalPopup" />
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1" PopupControlID="Panel1"></asp:ModalPopupExtender>
    
    <asp:Panel ID="Panel1" runat="server">
        <asp:TextBox ID="TxtNectarPoints" runat="server"></asp:TextBox>
        <asp:NumericUpDownExtender ID="NumericUpDownExtender1" runat="server" Maximum="100" Minimum="0" Step="5"
            TargetControlID="TxtNectarPoints" Width="50">
        </asp:NumericUpDownExtender>
    </asp:Panel>
    

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 16, 2015 5:27 AM

All replies

  • User61956409 posted

    Hi peterthegreat,

    I can get it to work once I take it out of the FieldSet element for example. In practice it is placed inside a ModalPopupExtender control.

    I create the following sample to reproduce your problem, NumericUpDownExtender works fine in modal popup.

    <asp:Button ID="Button1" runat="server" Text="ShowModalPopup" />
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1" PopupControlID="Panel1"></asp:ModalPopupExtender>
    
    <asp:Panel ID="Panel1" runat="server">
        <asp:TextBox ID="TxtNectarPoints" runat="server"></asp:TextBox>
        <asp:NumericUpDownExtender ID="NumericUpDownExtender1" runat="server" Maximum="100" Minimum="0" Step="5"
            TargetControlID="TxtNectarPoints" Width="50">
        </asp:NumericUpDownExtender>
    </asp:Panel>
    

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 16, 2015 5:27 AM
  • User1909155429 posted

    I discovered that the problem occurs when I set the Panel size the modal opens ?

     

    Friday, December 18, 2015 1:27 PM
  • User1777983149 posted

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

    Tuesday, December 22, 2015 9:33 AM