<form method="post" action="Create" runat="server"> <div> <%if (Model != null) { %> <%=Model.Id%> <%=Model.Name%> <%=Model.Dateofbirth%> <%=Model.Designation%> <%=Model.Salary%> <%} %> </div> <%=Html.TextBoxFor(m=>m.Id )%><br /> <%=Html.TextBoxFor(m=>m.Name) %><br /> <%=Html.TextBoxFor(m=>m.Dateofbirth) %><br /> <%=Html.TextBoxFor(m=>m.Designation )%><br /> <%=Html.TextBoxFor(m=>m.Salary )%><br /> <input type="button" value="Create" /> </form>
[HttpGet] public ActionResult Create() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(Employee emp) { return View("Show", emp); }
<input type="button" value="Create" onclick="" />
<input type="submit" value="Create" onclick="" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)