【问题标题】:can i use radio button list as Submit button?我可以使用单选按钮列表作为提交按钮吗?
【发布时间】:2011-09-15 12:42:30
【问题描述】:

我有:

<asp:RadioButtonList ID="selectedYesNoQuestionBlock7" runat="server" 
    RepeatDirection="Horizontal" OnSelectedIndexChanged="Question7GotAnswered">
    <asp:ListItem Text="Yes" Value="1"></asp:ListItem>
    <asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:RadioButtonList>

....

<div id="btCreate" style="margin-left: 254px; margin-top: 10px;">
    <asp:Button runat="server" Text="Categorize" ID="btCategorize" />
</div>

我想在选择列表项后提交 wothout 按钮。有可能吗?如何?

【问题讨论】:

    标签: c# asp.net radio-button submit radiobuttonlist


    【解决方案1】:

    查看RadioButtonList 控件公开的事件并将您的代码放入正确的事件处理程序中。我猜你也应该设置为 True AutoPostBack 的控件。

    【讨论】:

      【解决方案2】:

      为您的RadioButtonList设置AutoPostBack="true"

      <asp:RadioButtonList AutoPostBack="True" ID="selectedYesNoQuestionBlock7" 
            runat="server" RepeatDirection="Horizontal" 
                      OnSelectedIndexChanged="Question7GotAnswered">
       ...
      </asp:RadioButtonList>
      

      【讨论】:

        猜你喜欢
        • 2017-12-29
        • 1970-01-01
        • 2013-04-10
        • 1970-01-01
        • 2017-10-15
        • 1970-01-01
        • 2020-11-13
        • 2011-03-23
        • 2018-05-12
        相关资源
        最近更新 更多