Nov 06, 2014, 8:19 PM
[CLOSED] How to read dynamic checkbox value using request.form
Hi Guys,
Is possible read dynamic checkbox value using Request.Form?
This is my checkbox:
This is my code to read all the values from form:
It works with textField, I don't know how to do with checkboxes.
Is possible read dynamic checkbox value using Request.Form?
This is my checkbox:
var CheckItemAlternativa = new Ext.Net.Checkbox() { ID = "CK_" + objPer.IdPergunta + "_" + objAlternativa.IdAlternativa,
Name = "CK_" + objPer.IdPergunta + "_" + objAlternativa.IdAlternativa,
FieldLabel = objAlternativa.Label,
Value = "s"};
FieldSetQuestao.Items.Add(CheckItemAlternativa);
This is my code to read all the values from form:
It works with textField, I don't know how to do with checkboxes.
foreach (var control in Request.Form.Keys)
{
Classes.Resposta objResposta = new Classes.Resposta();
//get checkboxes values
if (control.ToString().StartsWith("CK_"))
{
if (!string.IsNullOrEmpty(Request.Form[control.ToString()]))
{
objResposta.Valor = Request.Form[control.ToString()];
listREsposta.Add(objResposta);
}
}
Thank's in advance.
Last edited by Daniil; Nov 11, 2014 at 4:27 AM.
Reason: [CLOSED]