Back to list
Views:   20.6K
Replies:  1

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

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?  

Ajeesh John, Feb 28, 2013
Reply 1
I found this on StackOverflow:

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

Orlando Owens, Mar 12, 2013
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.