Here I have created sample as per your requirement, I hope this help you out.
HTML
<div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
function ClearAnswerTextBox(button) {
var chk = $(button).closest('[id*=dlSubCategory]').find('[id*=chkSelect]');
if (chk.is(':checked') == false) {
alert('Plese Select checkbox to clear');
} else {
chk.each(function () {
if ($(this).is(':checked')) {
$(this).closest('tr').find('[id*=txtAnswer]').val("");
}
});
}
}
</script>
<asp:DataList ID="dlCategory" runat="server">
<HeaderTemplate>
<div class="buttn_hed_bg">
<div class="lm7 tm1 buttn_hed_txt">
Questions</div>
</div>
</HeaderTemplate>
<ItemTemplate>
<div class="lm5 tm2 buttn_txt">
<a href='#' class="buttn_txt">
<asp:Label ID="LblCat" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Name") %>'></asp:Label>
</a>
</div>
<asp:DataList ID="dlSubCategory" runat="server" DataSource='<%# GetSubByCategory()%>'>
<ItemTemplate>
<div class="buttn_div_sub">
<div class="lm40 tm2 buttn_txt">
<asp:CheckBox ID="chkSelect" runat="server" />
<asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Questions") %>'></asp:Label>
<asp:TextBox ID="txtAnswer" runat="server" />
</div>
</div>
</ItemTemplate>
<FooterTemplate>
<div>
<input type="button" id="btnClear" value="Clear" onclick="ClearAnswerTextBox(this)" />
</div>
</FooterTemplate>
</asp:DataList>
</ItemTemplate>
</asp:DataList>
</div>
C#
DataSet ds;
protected void Page_Load(object sender, EventArgs e)
{
ds = new DataSet();
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Name", typeof(string)),
new DataColumn("Questions",typeof(string)) });
dt.Rows.Add("John Hammond", "Question 1");
dt.Rows.Add("Mudassar Khan", "Question 2");
ds.Tables.Add(dt);
dlCategory.DataSource = ds;
dlCategory.DataBind();
}
public DataSet GetSubByCategory()
{
return ds;
}
Screenshot
After click on clear button