Home  /  Questions  /  Question



50   50
Feb 28, 2013


How to include a JavaScript call in an @Html.ActionLink?

Hi:
 
I have the following code for an ActionLink:
@Html.ActionLink("TextLink", "Action", "Controller", 
                 new { name= "Name1",address="Address1" },null )
How do I include an onclick JavaScript function into this?  

Regards
Ajeesh
 



50   50
Mar 12, 2013
I found this on StackOverflow:

<%=
Html.ActionLink("linky", "action", "controller", new { onclick = "someFunction();"}) %>