Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radiobuttonlist question

Status
Not open for further replies.

flnMichael

Programmer
Nov 13, 2003
96
US
Hey,
I know this is a 101 question, but I can't seem to figure this out. I have a radiobuttonlist and I want to know which one I chose so I can do some other functions. I've tried OSRdBtn.SelectedItem.Value = "Other" and OSRdBtn.SelectedItem.Text = "Other" and many variations using SelectedIndex, but it still craps out. What little thing am I doing wrong?

Thanks
Mike
 
Code:
if(myRBL.SelectedIndex != -1)
  Response.Write("The value selected is: " + myRBL.SelectedItem.Value);
If that doesn't work then there might be something else wrong. Does the control show up in your code-behind? ie:
protected System.Web.UI.WebControls.RadioButtonList myRBL;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top