How to submit partial view data from parent view .
I am newbie to MVC,
I have created a partial view _CurrentData which contains editor controls - textbox etc
and added Submit button in the main view:
<div class="row">
<div class="col-md-12">
@Html.Partial("_CurrentData", Model.CurrentItemDetails)
</div>
</div>
<div class="row">
<div class="col-md-2 col-md-offset-5">
<div>
<input type="button" class="btn btn-primary" value="Submit" id="btnSubmit"/>
<input type="button" class="btn btn-primary" value="Cancel" id="btnCancel" />
<br/><br />
</div>
</div>
</div>
ViewModel
public class ProductionViewModel
{
public ItemDetails CurrentItemDetails { get; set; }
}
public class ItemDetails
{
public int ID { get; set; }
public string Name { get; set; }
}
View
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Editor</h3>
</div>
<div class="panel-body">
<div class="row form-group">
<div class="col-sm-4 control-label text-right">
<strong>Name:</strong>
</div>
<div class="col-sm-8 control-label">
@Html.TextBoxFor(m => m.Name , new { @class = "form-control" })
</div>
</div>
</div>
</div>
now on clicking of 'btnSubmit' I want to submit data from _CurrentData view to the server and then refresh the partial view,
How to accomplish this?