简体   繁体   中英

c# radiobuttonlist control

I am relatively new to c# and the event handling concept.

Inside this function I need to get a reference to the RadioButtonList control that fired the event. Also, need to retrieve information from the selected radiobutton from the control

TIA

protected void Option_SelectedIndexChanged(object sender, EventArgs e)
    {
}
protected void Option_SelectedIndexChanged(object sender, EventArgs e)
{
    RadioButtonList sourceRadioButtonList = (RadioButtonList)sender;

    string selectedOption = sourceRadioButtonList.SelectedValue;
}

For more info, see: RadioButtonList class

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM