show-notice
hide-notice

Friday 23 August 2013

How to checked radio button value from datalist


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;
                }
            }
        }

SHARE THIS POST   

0 comments :

Post a Comment

Design by Gohilinfotech | www.gohilinfotech.blogspot.com