Click here to Skip to main content
15,789,776 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am insert studentname by textbox and currentstatus by radiobutton list value..

this is my radiobuttonlist

<asp:RadioButtonList ID="RadioBtnList1" runat="server" AppendDataBoundItems="true"  RepeatDirection="Horizontal">
                                 <asp:ListItem Text="Active" Value="0" ></asp:ListItem>
                                 <asp:ListItem Text="Deactive" Value="1"></asp:ListItem>

i need that when i select any student and if he is in database it makes true his selected current status radiobutton list.
Updated 30-Jun-14 2:55am

1 solution

Just a demo:
public void PopulateStudent(ID) //your selected student
 if (Convert.ToInt32(dr[0]["StudID"]) != 0) // Meaning student is in database
   RadioBtnList1.SelectedValue = dr[0]["StudentStatus"].ToString();
  RadioBtnList1.Items[0].Selected = false;
  RadioBtnList1.Items[1].Selected = false;
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900