Introduction:
Here i will explain How to checked radio button value from datalist.
Description:
Many time we use radio button but we not check his value in datalist. so i will provide tricks How to checked radio button value from datalist.
Example:
protected void btnSave_Click(object sender, EventArgs e)
{
foreach (RepeaterItem item in Repeater1.Items)
{
// Checking the item is a data item
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
var rdbList = item.FindControl("RadioButtonList1") as RadioButtonList;
// Get the selected value
string selected = rdbList.SelectedValue;
}
}
}
0 comments :
Post a Comment