Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @{
- ViewData["Title"] = "TakingSurvey";
- }
- @using (Html.BeginForm())
- {
- ICollection<SurveyAPI.Models.DB.Questions> _questions = ViewBag.questions;
- ICollection<SurveyAPI.Models.DB.Answers> _answers = ViewBag.answers;
- int i = 0;
- foreach (var question in _questions)
- {
- <div class="form-group">
- <label asp-for="@_questions.ElementAt(i).Answers">@_questions.ElementAt(i).QuestionText</label>
- <input asp-for="@_answers.ElementAt(i).AnswerText" class="form-control" />
- </div>
- i++;
- }
- <div class="form-group">
- <button type="submit" class="btn btn-default">Submit</button>
- </div>
- }
Add Comment
Please, Sign In to add comment