I’m starting to learn ASP.NET MVC.
I have a page with 2 forms, the current page is: http://localhost/Puzzles/5754
<form action="/Puzzles/5754/Solve" method="post">
<input type="text" name="solution" />
<input type="submit" />
</form>
<form action="/Puzzles/5754/write" method="post">
<input type="text" name="text" />
<input type="submit" />
</form>
My current routing is
routes.MapRoute(
"Puzzles",
"Puzzles/{puzzleId}",
new { controller = "Puzzles", action = "Details" }
);
How do I handle the submit?
I want the two form to go to the same View.
I’m willing to change the approach.
If you want context: The page shows a riddle, the user can submit a solution or write text asking for help.
There will be more forms, like rating\bookmark\ect…
Set this routing (default action is Details)
and in returning View of both controller actions (Solve, Write) add name of view