This is the only one that worked for me in .cshtml file:
@Html.ActionLink("Name", "Action", "Controller", routeValues: null, htmlAttributes:new Dictionary<string, object> {{ "onclick", "alert('Test');" }})
I hope this helps.
This is the only one that worked for me in .cshtml file:
@Html.ActionLink("Name", "Action", "Controller", routeValues: null, htmlAttributes:new Dictionary<string, object> {{ "onclick", "alert('Test');" }})
I hope this helps.