Hi
@model MyApplication.Models.Location
@using (Html.BeginForm("CreateEdit", "Location", FormMethod.Post))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
}
*******************Controller
[HttpGet]
public ActionResult CreateEdit(string Id)
{
Id = Id.Trim();
////try
////{
if (String.IsNullOrEmpty(Id))
{
return PartialView("_CreateEdit", new Location());
}
else
{
return PartialView("_CreateEdit", dbLocation.GetById(Id));
}
//}
//catch (Exception ex)
//{
// ExceptionLogging.SendExcepToDB(ex);
// TempData["Message"] = "Error Encountered.";
//}
}
Thanks
Sachin SinghPosted Jun 22, 2021, 8:03 AM
@Model.Id, obviously
Sachin SinghPosted Jun 22, 2021, 8:03 AM
Ramco RamcoPosted Jun 22, 2021, 1:55 AM
Sachin SinghPosted Jun 21, 2021, 6:54 PM