asp.netvb.netbuttonradiobuttonlist

RadioButtonList on ASP.NET (VB)


I have a RadioButtonList which contain 4 radio buttons A,B,C,D

RBQ.Items.Add("A")
RBQ.Items.Add("B")
RBQ.Items.Add("C")
RBQ.Items.Add("D")

How can set the selected value to the radio button who has the value "B"?


Solution

  • RBC.Items.FindByValue("B").Selected = True
    

    or

    RBC.SelectedValue = 2
    

    Grz, Kris.