Here is my View
@using (Html.BeginForm("updateFeedback", "Questionnaire", FormMethod.Post))
{
for (int i = 0; i< Model.Count(); i++)
{
Q @Html.DisplayFor(item => item[i].QuestionSeq). @Html.DisplayFor(item => item[i].Question)
var model = Model[i];
if (model.AnsType.Equals("Scale2"))
{
<label>@Html.RadioButton("Question" + model.QuestionSeq, 1)Much Better</label>
<label>@Html.RadioButton("Question" + model.QuestionSeq, 2)Better</label>
<label>@Html.RadioButton("Question" + model.QuestionSeq, 3)About the same</label>
<label>@Html.RadioButton("Question" + model.QuestionSeq, 4)Worse</label>
<label>@Html.RadioButton("Question" + model.QuestionSeq, 5)Much Worse</label>
}
if (model.AnsType.Equals("Scale6"))
{
<label>@Html.RadioButton("Question" + model.QuestionSeq, 1)Very Likely</label>
<label>@Html.RadioButton("Question" + model.QuestionSeq, 2)Likely</label>
<label>@Html.RadioButton("Question" + model.QuestionSeq, 3)Neutral</label>
<label>@Html.RadioButton("Question" + model.QuestionSeq, 4)Unlikely</label>
<label>@Html.RadioButton("Question" + model.QuestionSeq, 5)Very Unlikely</label>
}
}
<input type="submit" value="Submit" />
}
The values for the RadioButton is coming as null in the controller. I understand the syntax should be @html.RadiobuttonFor but i am unable to frame it in the current context.
Help will be appreciated.
Thanks in advance.