Reputation: 21
@Html.ActionLink("PostActionName","MyController")
Here I want to call PostActionName
which having HttpPost
Verb.
Currentlly i am not able to call PostActionName
. It only calling HttpGet verb Action.
Upvotes: 1
Views: 395
Reputation: 51
You can't call POST Action method using @Html.ActionLink,
instead you can use @Ajax.ActionLink
to call a POST action method.
Firstly you need Scripts
<script src="∼/Scripts/jquery-1.10.2.js"></script>
<script src="∼/Scripts/jquery.unobtrusive-ajax.js"></script>
@Ajax.ActionLink("Action Name", "PostActionName", new AjaxOptions { HttpMethod = "Post"})
Upvotes: 1