Please refer this code
HTML
<form id="form1" runat="server">
<div>
Please check which degree you have completed and from where
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table border="0" cellpadding="0" cellspacing="0">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:CheckBox ID="chkDegreeType" Text='<%# Eval("Degree") %>' runat="server" />
<asp:TextBox ID="txtCollageName" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<br />
<asp:Button Text="Save" OnClick="Save" runat="server" />
</div>
</form>
Namespace
using System.Data;
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[1] { new DataColumn("Degree", typeof(string)) });
dt.Rows.Add("Diploma");
dt.Rows.Add("BE");
dt.Rows.Add("ME");
Repeater1.DataSource = dt;
Repeater1.DataBind();
}
}
protected void Save(object sender, EventArgs e)
{
foreach (RepeaterItem item in this.Repeater1.Items)
{
CheckBox chk = item.FindControl("chkDegreeType") as CheckBox;
if (chk.Checked)
{
string collageName = (item.FindControl("txtCollageName") as TextBox).Text;
string degree = chk.Text;
this.SaveData(degree, collageName);
}
}
}
private void SaveData(string checkbox, string textbox)
{
//Write code here to save the Data . checkbox and textbox
}
Screenshot