Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net vb.net单选按钮选择_Asp.net_Vb.net - Fatal编程技术网

Asp.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>

我在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>

对
不
我需要通过编程从两个列表项中选择一个。 如何在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

我如何在程序上做到这一点?这是一个答案吗?很好,我以前没有见过这些方法。