| 1. |
How We Can Multiple Submit Buttons In Asp.net Mvc? |
|
Answer» Below is the scenario and the solution to SOLVE multiple submit buttons issue. Scenario : @using (Html.BeginForm("MyTestAction","MyTestController") { <INPUT type="submit" value="MySave" /> <input type="submit" value="MyEdit" /> } Solution : PUBLIC ActionResult MyTestAction(STRING submit) //submit will have value EITHER "MySave" or "MyEdit" { // Write code here } Below is the scenario and the solution to solve multiple submit buttons issue. Scenario : @using (Html.BeginForm("MyTestAction","MyTestController") { <input type="submit" value="MySave" /> <input type="submit" value="MyEdit" /> } Solution : Public ActionResult MyTestAction(string submit) //submit will have value either "MySave" or "MyEdit" { // Write code here } |
|