SyntaxFix
Write A Post
Hire A Developer
Questions
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.