Aleena Saviour

Aleena Saviour

  • NA
  • 519
  • 87.7k

bootstrap modal popup with mvc5

Jul 28 2017 5:51 AM
when i click on edit link for open modal popup it fills with previous data...?
i'm using partial view..
my partial view given below
 
<div class="">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h3 class="modal-title">Save StockIn</h3>
</div>
<br/>
@using (Html.BeginForm("Save", "Stock", FormMethod.Post, new { role = "dialog", id = "EditForm" }))
{
@Html.AntiForgeryToken()
<div class="modal-body">
<h4>StockIn</h4>
<hr/>
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<fieldset>
@Html.HiddenFor(model => model.PKStockInId)
<div class="form-group">
@Html.Label("Product", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownList("PKProductId", (IEnumerable<SelectListItem>)ViewBag.Prod, "Select", new { @class = "form-control", @id = "ddlProduct" })
@Html.ValidationMessageFor(model => model.PKProductId, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.Label("Quantity", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Quantity, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Quantity, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.Label("Unit", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownList("PKUnitId", (IEnumerable<SelectListItem>)ViewBag.Unit, "Select", new { @class = "form-control", @id = "ddlUnit" })
@Html.ValidationMessageFor(model => model.PKUnitId, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.Label(" Unit Price", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.UnitPrice, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.UnitPrice, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.Label("Total Price", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.TotPrice, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.TotPrice, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.Label("Stock Date", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.StockDate, new { htmlAttributes = new { @class = "form-control", @id = "datepicker" } })
@Html.ValidationMessageFor(model => model.StockDate, "", new { @class = "text-danger" })
</div>
</div>
</fieldset>
<div class="modal-footer">
<button type="submit" id="btnSave" class="btn btn-success btn-circle btn-raised">Submit</button>
<button type="button" class="btn btn-circle" id="reset" data-dismiss="modal">Cancel</button>
<div id="msg"></div>
</div>
</div>
}
</div>
 
main view is given below...
 
 
<div id="edit-modal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
</div>
</div>
</div>
 
link loads popup given below
 
 <a href='/Stock/Save/" + row.PKStockInId + "' class='modal-edit'>Edit</a>&nbsp; 
 
 

Answers (1)