Hi I am having difficulties using Url.Action
method, please see my code below, what am I doing wrong....? (I'm using MVC Razor)
<a href='<%: @Url.Action("Edit", "Student",
new { id = item.DealPostID }) %>'>Hello </a>
Student
is my StudentController
and Edit
is ActionResult
method.
Remove <%: %>
from your Razor view. Those are WebForms tags.
<a href='@Url.Action("Edit", "Student",
new { id = item.DealPostID })'>Hello </a>
Try this:
@Html.ActionLink("Hello", "Edit", "Student", new { id = item.DealPostID }, null)
That should work out for you.
<a href='@Url.Action("Index", "Cliente", "Home")'>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.