I’m working with MVC, I have a view with an ActionLink that calls an Action of my controller, my issue is when I want to call also a javascript function on the onClick() event of that action link (as that action link converts to html standart tag on execution time). How should i do this? what is the better way?
Here is the code of my ActionLink:
<%=Html.ActionLink("View Report", "GeneratePdf", new { strProductId = myObject.productId})%>
Thanks.
Give the link an id (or class) and apply the handler unobtrusively using javascript. Example using jQuery: