I am Developing an Employee ASP.NET MVC Base Apllication, But the Problem is that I want to select a particular Employee Like the one Below without using the same page with the input form.
| Name | Sulon |
| Address | Pibilla |
| City | EmpireLodge |
Submit
Name Address City
Sulon Pibila EmpireLoge
Sulon Pibilla EmpireLoge
Sulon Pibilla EmpireLoge
I want it that if An employee Enter His Details in One form, then He get the details in Another form. Please I need Help. Any Answer is highly appreciated.
public ActionResult Add_Record()
{
return View();
}
[HttpPost]
public ActionResult Add_Record(FormCollection FmC)
{
string user = FmC["Name"];
Employee Emp = new Employee();
Emp.Name = FmC["Name"];
Emp.Address = FmC["Address"];
Emp.City = FmC["City"];
Emp.Pin_Code = FmC["Pin_Code"];
Emp.Designation = FmC["Designation"];
DAlayer.AddDetails(Emp);
var Data = USB.tbl_Employee.Where(x => x.Name == user);
return View(Data);
//return RedirectToAction("SRD");
}
View State
@model IEnumerable
@{
Layout = null;
}
|
@Html.DisplayNameFor(model => model.Name)
|
@Html.DisplayNameFor(model => model.Address)
|
@Html.DisplayNameFor(model => model.City)
|
@Html.DisplayNameFor(model => model.Pin_Code)
|
@Html.DisplayNameFor(model => model.Designation)
| |
|---|---|---|---|---|---|
|
@Html.DisplayFor(modelItem => item.Name)
|
@Html.DisplayFor(modelItem => item.Address)
|
@Html.DisplayFor(modelItem => item.City)
|
@Html.DisplayFor(modelItem => item.Pin_Code)
|
@Html.DisplayFor(modelItem => item.Designation)
|
Anoop Kumar SharmaPosted Mar 31, 2019, 9:30 AM