Hi I am having a doubt abt a CheckBox in a Repeater Control.
When a checkBox is false I am unable to set Attributes..
this is what my code in C#
if (rptId == 14)
{
CheckBox chk = (CheckBox)e.Item.FindControl("chkEP");
chk.Attributes.Add("rptId", reportId.ToString());
chk.Attributes.Add("grpId", grpId.ToString());
if (chk != null)
chk.Checked = false;
}
public void chkEP_OnCheckedChanged(Object sender, EventArgs e)
{
CheckBox cb = (CheckBox)sender;
int rptId = int.Parse(cb.Attributes["rptId"]);
int grpId = int.Parse(cb.Attributes["grpId"]);
if (cb.Checked == true)
{
//dosomething
}
else
{
//dosomething
}
}
When a checkBox is false I am unable to set Attributes..
this is what my code in C#
if (rptId == 14)
{
CheckBox chk = (CheckBox)e.Item.FindControl("chkEP");
chk.Attributes.Add("rptId", reportId.ToString());
chk.Attributes.Add("grpId", grpId.ToString());
if (chk != null)
chk.Checked = false;
}
public void chkEP_OnCheckedChanged(Object sender, EventArgs e)
{
CheckBox cb = (CheckBox)sender;
int rptId = int.Parse(cb.Attributes["rptId"]);
int grpId = int.Parse(cb.Attributes["grpId"]);
if (cb.Checked == true)
{
//dosomething
}
else
{
//dosomething
}
}