Hi seriverma,
I have created sample that full-fill your requirement. For this sample i have used Northwind database. In order to download the database you will need to visit the following URL.
HTML
<center>
<b>Categories:</b>
<table id="tblRadioLists">
</table>
<br />
<b>Selected Value:</b> <span id="lblCategory"></span>
</center>
<div>
<script type="text/javascript">
$(function () {
$.ajax({
type: "POST",
url: "Default.aspx/GetCategories",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
var table = $("[id*=tblRadioLists]");
$.each(r.d, function () {
var rdb = "<tr><td><input id=rb" + this['Text'] + " onclick=CheckedCategory(this) type='radio' name='rbCategories' value=" + this['Text'] + " /><label for=lbl" + this['Text'] + ">" + this['Text'] + "</label></td></tr>";
table.append(rdb);
});
}
});
});
function CheckedCategory(checkedRadio) {
$('[id*=lblCategory]').text(checkedRadio.value);
}
</script>
</div>
Code
[WebMethod]
public static List<ListItem> GetCategories()
{
string query = "SELECT CategoryID, CategoryName FROM Categories";
string constr = ConfigurationManager.ConnectionStrings["conStr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand(query))
{
List<ListItem> Categories = new List<ListItem>();
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
con.Open();
using (SqlDataReader sdr = cmd.ExecuteReader())
{
while (sdr.Read())
{
Categories.Add(new ListItem
{
Value = sdr["CategoryID"].ToString(),
Text = sdr["CategoryName"].ToString()
});
}
}
con.Close();
return Categories;
}
}
}
Screenshot