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 SinghRank #66 · 26.2K reputationPosted Jun 22, 2021, 4:03 AM EDT
@Model.Id, obviously
Sachin SinghRank #66 · 26.2K reputationPosted Jun 21, 2021, 2:54 PM EDT