I have a MVC3 C # .NET web application and need to call a view using Html.ActionLink. I cannot tell from the documentation if I can specify POST or GET. Below is my HTML, is there any way to specify GET or POST?
@Html.ActionLink("Create New", "Edit", "Subtask", new {Id = ViewBag.Id, Command="CreateHourEntry"}, null)
If you want to use the Ajax.ActionLink post, but be careful about the Ajax post. You can easily use jquery to link your existing link with a form post, but this feature is not included in Html.ActionLink.
See ASP.NET MVC ActionLink and Submission Method
HTML hyperlinks send a GET.
In 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"})