I try to access the posted value from a checkbox and if it is checked or not. I currently have this..
<input type="checkbox" value="2" class="form-check-input" id="chk1">
for (i = 1; i <= Convert.ToInt32(HiddenNumberOfControls.Value); i++)
{
chkName = ("chk" + i);
var ctrl = Request.Form[chkName];
if (ctrl == "on")
{
}
}
I can see if the checkbox is checked or not using this but is it possible to get its value?
Got it working by setting the checkbox value like this
.InputAttributes.Add("value", "myVal");