I have two tables in one table i have question id and question name and other table have option id , option namee and question id i have to view question and his option on screen and this is my code but problem is question is writen with every option and i want 1 question and his options can anyone help me on this
public class ExamController : Controller
{
Exam_systemEntities1 dbobj = new Exam_systemEntities1();
public ActionResult Question_Paper(int id)
{
return View(dbobj.Sp_Question_Paper(id).ToList());
}
}
@model IEnumerable
@{
ViewBag.Title = "Detail_View_Question";
char i = 'a';
}
Detail_View_Question
@using (Html.BeginForm())
{
foreach (var item in Model)
{
@item.question_name
foreach(var itemm in Model)
{
@i) @item.option_name
}
i++;
}
}
Replies
Know the answer? Post it — somebody with the same question will find it here.