Calling a specific action of a controller on the click of HTML button(Not Submit or Form's post Button) Asp.net MVC

48,888

any form that directs your user to url created by

<a href='@Url.Action("{action}", "{controller}")'> click me </a> 

or

@using(BeginForm("{action}", "{controller}")

will do what you want.

That can be with a

  • form
  • button link

It's the destination that matters. The View does not "know" anything about the action or controller. The helper does.

Share:
48,888
Yogesh
Author by

Yogesh

Updated on July 09, 2022

Comments