How can i get the index of the button that is selected in a
radiobuttonlist?
I have a radiobuttonlist that contains 5 buttons, and i do a switch on
what index that is selected, like this:
Session["rblMarked"] = GetIndexString( rblMarked.SelectedIndex );
Session["rblCustomersSeriosly"] = GetIndexString(
rblCustomersSeriosly.SelectedIndex );
....
then the method GetIndexString:
private string GetIndexString( int index )
{
string temp = "";
switch(index) {
case 0:
temp = "Stor innverknad";
break;
case 1:
temp = "Ein del innverknad";
break;
case 2:
temp = "Middels innverknad";
break;
case 3:
temp = "Lite innverknad";
break;
case 4:
temp = "Ingen innverknad";
break;
}
return temp;
}
But the number 0 is coming from .SelectedIndex no matter what button i
push...why?
I really appreciate some quick help..i've got time pressure on this
project! :)
Thanks!
Svein Erik.