Select the radio button list value

Posted by Gokularts2006 under C# on 4/20/2012 | Points: 10 | Views : 3372 | Status : [Member] | Replies : 2
Hi

I insert the radio button list(Male and female) value to db.i set the value as a 0 and 1 in asp page.Now i need to select d display the stored value for further updates.i tryed one type of c# code it metioned in blow.But it not working properly. kindly any one assist me.

foreach (ListItem lst in RbGender.Items)
{
if (lst.Value.ToString() == dr["Male"].ToString())
{
lst.Selected = true;
}
}

thanks

Gokulakrishnan


Responses

Posted by: Sabarimahesh on: 4/20/2012 [Member] Bronze | Points: 25

Up
0
Down
Gokularts2006

Can you Ask the Question Clearly ...

sorry i can Get u


Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Subbiraj on: 4/21/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
you are matching it by String("Male").....correct your code put here as have set 0 or 1 accordingly.

Subhash.C

Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response