-
Notifications
You must be signed in to change notification settings - Fork 10.3k
RedirectToAction() makes the link to HttpPost action instead of GET #23089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@IgorXq thanks for contacting us. Can you provide a minimal repro project and host it somewhere public (GH repo or upload it as a zip here) so that can make sure we are not missing any detail? |
@javiercn thank you for a quick response. Please check the demo project here https://github.com/IgorXq/mvcdemo If you run it, you can open the URL
that leads to the example page with correct and incorrect links formed by asp tag helpers. The page |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Thanks for contacting us. |
I was able to reproduce this behavior. This seems like a bug IMO. |
Has this issue been resolved. And if so, which versions of .Net? |
Hi !
For GET and POST methods with the same action names,
generates lincorrect link that in my case eventually led to "too many redirects". (as far as I have investigated, it happens because the link is generated to HttpPost method instead of HttpGet when they both have the same name)
The issue happens for route patterns such as [Route("[controller]/{parameter}/action}")]
and does not happen for the route patterns like [Route("[controller]/action/{parameter}")]
Just to mention, HttpPost action has route pattern [Route("[controller]/action")] (parameter passes in ViewModel)
I have managed with the issue having renamed POST methods so that their names don't match with GET methods.
As for me, such behavior seems incorrect (as well as that RedirectToAction considers POST methods at all to generate links) or I might have lack of knowledge about ASP.Net core MVC routing.
The text was updated successfully, but these errors were encountered: