开发者

can i use radio button list as Submit button?

开发者 https://www.devze.com 2023-03-12 23:29 出处:网络
i have: <asp:RadioButtonList ID=\"selectedYesNoQuestionBlock7\" runat=\"server\" RepeatDirection=\"Horizontal\" OnSelectedIndexChanged=\"Question7GotAnswered\">

i have:

<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>
</as开发者_StackOverflowp:RadioButtonList>

....

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

i want to submit wothout button, just after selecting list item. is it possible and how??


Set AutoPostBack="true" for your RadioButtonList

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


Look at the event exposed by the RadioButtonList control and put your code in the proper event handler. I guess you should set to True AutoPostBack of the control as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消