public ActionResult test4() { return View(); } [HttpPost] public ActionResult test4(string submit1 ,string submit2) { if (!string.IsNullOrEmpty(submit1)) { return Content("test1"); } else if (!string.IsNullOrEmpty(submit2)) { return Content("test2"); } else return View(); }
@model xyzz.Models.xyztable @{ ViewBag.Title = "test4"; } <h2>test4</h2> @using (@Html.BeginForm("test4","xyz",FormMethod.Post)) { <input type="submit" name="submit1" value="submit1" /> <input type="submit" name="submit2" value="submit2" /> }
Server Error in '/' Application.
Requested URL: /xyz/test4
Controller
Html.BeginForm
@using (@Html.BeginForm("test4","xyzs",FormMethod.Post))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)