MVC Widget Hybrid Mode on Home Page
I'm having issues with a MVC widget. It's a Registration form that sits on the home page.
The controller is similar to:
The Default.cshtml and Success.html files are under the ~/Views/RegisterForInterestMvc folder in the solution.
Two issues occur:
The only way I can route to my success page is by changing the Post action to
Which results in a page url which is ugly mywebsite/.../success
How can I create more user friendly routes in Hybrid mode?
You can use an attribute like [ActionName("Success")] on any action to make it listen for that route value.
Another way to control what happens it to override the protected method called HandleUnknownAction and implement logic that decides what to render based on whatever action is requested.
Thanks for the information it certainly helped on non home pages but the issue on the home page still persists with both suggestions.
When I click home from the navigation menu and then click submit the form posts to localhost:60876/Index and I get a 404
This is a known issue at our end and we already have it logged internally.
However, I made a feedback item for you in our feedback portal, so that you can track the issue yourself:
Let me know if I can be of further help to you.