Guest User

Untitled

a guest
Jul 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. @{
  2. ViewData["Title"] = "TakingSurvey";
  3. }
  4. @using (Html.BeginForm())
  5. {
  6. ICollection<SurveyAPI.Models.DB.Questions> _questions = ViewBag.questions;
  7. ICollection<SurveyAPI.Models.DB.Answers> _answers = ViewBag.answers;
  8. int i = 0;
  9. foreach (var question in _questions)
  10. {
  11. <div class="form-group">
  12. <label asp-for="@_questions.ElementAt(i).Answers">@_questions.ElementAt(i).QuestionText</label>
  13. <input asp-for="@_answers.ElementAt(i).AnswerText" class="form-control" />
  14. </div>
  15. i++;
  16. }
  17. <div class="form-group">
  18. <button type="submit" class="btn btn-default">Submit</button>
  19. </div>
  20. }
Add Comment
Please, Sign In to add comment