I have Ajax.ActionLink that POSTS to a method on a controller and passes an Id. It definitely posts as I have decorated the method with: [HttpPost]. The url is displaying the Id value. Is this correct, as I would have thought POSTing would hide the Id from the url. I'm wondering if this is default functionality of MVC3 or whether I need to change my routevalues? Thanks
Asked
Active
Viewed 566 times
1
-
Have you specified the type of the ActionLink to be POST? – yoozer8 Feb 22 '12 at 17:44
-
oops - typo in my code - sorry! – user1079925 Feb 22 '12 at 17:50
1 Answers
0
Decorating the controller method is not enough, and doesn't look to be the problem in this case.
If the id is showing as part of the URL, the request is likely a GET rather than a POST.
You can specify the request type in the Ajax.ActionLink. Make sure you indicate that it should be a POST.
Do this using AJAX Options.

yoozer8
- 7,361
- 7
- 58
- 93