MVC3 Html.ActionLink Post

若如初见. 提交于 2019-11-29 10:34:30
Adam Tuliper - MSFT

If you want a post use Ajax.ActionLink but be aware it's an Ajax post. You could easily use jquery to cause your existing link to cause a form post but this functionality is not included in Html.ActionLink.

See ASP.NET MVC ActionLink and post method

HTML hyperlinks send GETs.

To POST, you need to use a form.
or some Javascript

You can also use Ajax.ActionLink where you can specify POST or GET

@Ajax.ActionLink("Create New", "Edit", "Subtask",
                  new AjaxOptions{ HttpMethod="Post"}) 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!