Skip to content
Advertisement

how to call javascript function in html.actionlink in asp.net mvc?

How can one call a javascript function in html.actionlink in asp.net mvc?

I want to call one method, which is in JavaScript, but how I call it within html.actionlink in the same page?

Advertisement

Answer

you need to use the htmlAttributes anonymous object, like this:

JavaScript

you could also give it an id an attach to it with jquery/whatever, like this:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement