Hi,
I want to pass only one record at a time from the list & on the clicking of next button fetch the another record from the list .
Below is my Controller:-
- public ActionResult Questions()
- {
- List<QuestionsModel> quesLOV = new List<QuestionsModel>();
- QuestionsModel quesModel = new QuestionsModel();
- quesModel.Ques_ID = 1;
- quesModel.Questns = "Qualities of Deliverable";
- quesLOV.Add(quesModel);
- quesModel = new QuestionsModel();
- quesModel.Ques_ID = 2;
- quesModel.Questns = "Adherence to timeliness/Schedule";
- quesLOV.Add(quesModel);
- quesModel = new QuestionsModel();
- quesModel.Ques_ID = 3;
- quesModel.Questns = "Estimation Accuracy?";
- quesLOV.Add(quesModel);
- return View(quesLOV.ToList());
- }
VIEW:-
- @model IList<QuizDemo.Models.QuestionsModel>
- @{
- ViewBag.Title = "Questions";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- <div class="container-fluid">
- <hr />
- <form style="padding-top:50px">
- <div class="alert alert-dismissible alert-primary">
- @foreach (var Obj in Model)
- {
- <label style="font-size:25px;padding-bottom:50px">Questions:@Obj.Questns</label>
- <input id="input-1" name="input-1" class="rating rating-loading" data-min="0" data-max="5" data-step="0.1" value="2" data-size="sm">
- }
- </div>
- <button type="button" class="btn btn-outline-primary btn-lg" style="float:right">Next</button>
- </form>
- </div>
Please suggest .
Thank you