I'm using AspNet Identity 2 without modification. The Logon, Register, Change Password, etc. views fail to post when I deploy to WinHost. Everything works OK when I deploy to my test server. I can make the production app work if I remove all the HTML.BeginForm parameters.
This does not work: @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
This works: @using (Html.BeginForm())
I've tried various beginform overloads without success. My app is MVC 5.2.7 with entity framework 4.6.1. I'm using VS 2017 v 15.5.7
I found the problem. I had a URL Rewrite rule in IIS that caused a 301 rewrite if the URL had upper case characters. The 301 redirect causes an HTTP POST to become a GET. Disabling the rule fixed the problem. https://softwareengineering.stackexchange.com/questions/99894/why-doesnt-http-have-post-redirect/99966#99966 says you can doe a 307 redirect. I changed the rule to do a 307 but the POST was still redirected to a GET. I left the rule disabled.