@model IList<myProject.ViewModels.QuestionViewModel> @{ Layout = "~/Views/Shared/_Layout.cshtml"; } @{ ViewBag.Title = "Event Questions"; } <h2> Event Questions</h2> @using (Html.BeginForm("PostAnswers", "EventQuestions", FormMethod.Post)) { <table class="table"> @for (var i = 0; i < Model.Count(); i++) { <tr> <td> @Html.HiddenFor(x => x[i].EventId) @Html.HiddenFor(x => x[i].QuestionId) @Html.DisplayFor(x => x[i].QuestionText) <br /> @if () { @Html.HiddenFor(x => x[i].AnswerText, new { @class = "form-control" }) } else { @Html.TextBoxFor(x => x[i].AnswerText, new { @class = "form-control" }) } </td> </tr> } </table> <input type="submit" value="Submit" class="btn btn-primary btn-md" /> @*Html.ActionLink("Submit", "PostAnswers")*@ }
@if (Model[i].EventId == 1)
@if (eventID == 1) { Html.HiddenFor(x => x[i].AnswerText, new { @class = "form-control" }); } else { Html.TextBoxFor(x => x[i].AnswerText, new { @class = "form-control" }); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)