I have the following
@Html.ActionLink("Edit", "EditProg", new { id = item.ID })
I like to know how to also supply the above with a name as I need trap this name before it is submitted. Is there something like name = "EditLink"?
You mean like adding a name attribute to the anchor (even if this attribute is not valid on an anchor)?
@Html.ActionLink(
"Edit", // linkText
"EditProg", // actionName
new { id = item.ID }, // routeValues
new { name = "EditLink" } // htmlAttributes
)
or sending it to the controller as query string parameter?
@Html.ActionLink(
"Edit", // linkName
"EditProg", // actionName
new { // routeValues
id = item.ID,
name = "some name"
}
)
You could used Url.Action instead?
<a href="@Url.Action("EditProg")" id="@item.ID" name="editlink" >
@Html.ActionLink("EditLink","Edit", "EditProg", new { id = item.EmpID })