i need help.
i have two views one is main and other is partial.
on main view i have this:
@model DataBase.Poll
@using(Html.BeginForm("SavePollDetials","AdminCustomer"))
{
@Html.HiddenFor(model => model.Poll_ID)
@Html.TextBoxFor(model => model.Poll_Question)
@Html.Action("Epollvote", "AdminCustomer", new { id = @Model.Poll_ID })
}
now on Epollvote action
public PartialViewResult Epollvote(int id)
{
var q = from d in _db.Poll_Answer where d.Poll_ID == id select d;
return PartialView("~/Views/Admin/Poll/EResultVote.cshtml",q.ToList());
}
and on EResultVote.cshtml partial view i have:
@model IEnumerable<database.poll_answer>
@foreach (var item in Model)
{
@Html.HiddenFor(model => item.Poll_Ans_ID)
@Html.TextBoxFor(model => item.Answer)
}
and finally what i want is to access these above fields details in SavePollDetials action. currently i have this but send model is null. i'm using entity framework and these poll and poll_answer are entities.
public ActionResult SavePollDetials(Poll model,IEnumerable<poll_answer> model1)
{
return view();
}