Hi,
I am doing an mvc application.
I am unable to send data from view to controller.
View code @Html.ActionLink(item.coursename,"Details","Home",new {name=item.coursename})
@model IEnumerable
Index
@foreach(var item in Model)
{
}
controller code:
public ViewResult Details(string name)
{
return View(db.students.Where(x=>x.cousename==name.ToString()).ToList());
}
the parameter value for string name is showing null.
thanks in advance
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bryian TanPosted Jul 14, 2018, 1:30 PM
Bryian TanPosted Jul 14, 2018, 2:20 PM
harry codePosted Jul 14, 2018, 1:54 PM
harry codePosted Jul 14, 2018, 1:48 PM