Asp.net vb.net单选按钮选择
我在vb.net中有以下内容Asp.net vb.net单选按钮选择,asp.net,vb.net,Asp.net,Vb.net,我在vb.net中有以下内容 <asp:RadioButtonList ID="rbEdit5" runat="server" RepeatDirection="horizontal" > <asp:ListItem Value="1" >Yes</asp:ListItem> <asp:ListItem Value="0" >No</asp:ListItem> </asp:RadioButtonList>
<asp:RadioButtonList ID="rbEdit5" runat="server" RepeatDirection="horizontal" >
<asp:ListItem Value="1" >Yes</asp:ListItem>
<asp:ListItem Value="0" >No</asp:ListItem>
</asp:RadioButtonList>
对
不
我需要通过编程从两个列表项中选择一个。
如何在vb.net中以编程方式选择上面的“是”
<asp:RadioButtonList ID="rbEdit5" runat="server" RepeatDirection="horizontal" >
<asp:ListItem Value="1" >Yes</asp:ListItem>
<asp:ListItem Value="0" >No</asp:ListItem>
</asp:RadioButtonList>
For Each li As ListItem In rbEditTop25.Items
If li.Text= "Yes" Then
li.Selected = True
End If
Next
你应该做这个把戏 这应该有效:
rbEditTop25.Items.FindByText("Yes").Selected = True
我如何在程序上做到这一点?这是一个答案吗?很好,我以前没有见过这些方法。