According a guide it says I need simply add Post before the method name. However when I tried it doesn’t work. However if I add [HttpPost] above the method name then it works as intended.
I wonder should PostMyMethodName() also work. Or does the guide I was reading had it wrong?
I guess you are talking about ActionFilter attribute in ASP.NET MVC.
[HttpPost]Action filter attributes is used to restrict an action method so that the method handles only HTTP POST requests. So you have to have it before the action method name for your controller to handle the form post meant for that action. If you do not mention any Action filter, It will be considered as HTTPGET([HttpGet])