Partial View Add and edit operation but when we click save button at time of edit validation message not display
--Partial View Add Edit ----
@model Cyborg.Models.Department
@{
Layout = null;
}
<div class="card">
<div class="card-header pb-4">
<div class="row">
<div class="col-sm-12 col-md-8">
<h5>Department Information</h5>
</div>
</div>
</div>
@using (Ajax.BeginForm("AddEditDepartments", "Departments", null, new AjaxOptions { HttpMethod = "Post", OnSuccess = "CreateUpdateDeptSuceess" }, new { @class = "form", Page = "DeptForm" }))
{
@Html.ValidationSummary(true, "", new { @class = "text-denger" })
@Html.HiddenFor(model => Model.DeptId)
<div class="card-body pl-3 pr-3 pb-1 pt-2" id="card1">
<div class="row">
<div class="col-md-12">
<div class="form-group mb-1">
<label class="col-form-label-sm-user text-black-50" for="ddlPlantId">Plant @Html.ValidationMessageFor(model => model.PlantId, "", new { @class = "text-danger" })</label>
@Html.DropDownListFor(model => model.PlantId, ViewBag.PlantList as SelectList, "Select Plants", new { @class = "mb-3 form-control form-control-sm ddlPlantId" })
</div>
</div>
<div class="col-md-12">
<div class="form-group mb-1">
<label class="col-form-label-sm-user text-black-50" for="txtDeptName">
Department Name
@Html.ValidationMessageFor(model => model.DeptName, "", new { @class = "text-danger" })
</label>
@Html.EditorFor(model => model.DeptName, new { htmlAttributes = new { @class = "mb-3 form-control", @Type = "text", @placeholder = "Ex.HR" } })
</div>
</div>
<div class="col-md-12">
<div class="form-group mb-1">
<label class="col-form-label-sm-user text-black-50" for="txtDeptName">
Email Id
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</label>
@Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "mb-3 form-control", @Type = "text", @placeholder = "Ex.HR@gmail.com" } })
</div>
</div>
<div class="col-md-12">
<div class="form-group mb-1">
<label class="col-form-label-sm-user text-black-50" for="txtDeptName">
Mobile No
@Html.ValidationMessageFor(model => model.MobileNo, "", new { @class = "text-danger" })
</label>
@Html.EditorFor(model => model.MobileNo, new { htmlAttributes = new { @class = "mb-3 form-control", @Type = "text", @placeholder = "Ex.8998767787",@maxlength = "10" } })
</div>
</div>
<div class="col-md-12">
<div class="form-group mb-1">
<label class="col-form-label-sm-user text-black-50" for="txtDeptName">
Location
@Html.ValidationMessageFor(model => model.Location, "", new { @class = "text-danger" })
</label>
@Html.EditorFor(model => model.Location, new { htmlAttributes = new { @class = "mb-3 form-control", @Type = "text", @placeholder = "Ex.Bytko", @maxlength = "20000" } })
</div>
</div>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12 text-right">
<button type="submit" class="btn btn-sm btn-theme pull-right" value="Save">Save</button>
</div>
</div>
</div>
}
</div>