on view side
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>Checkbook</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.Chq_Name, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownList("CheqLIst", new SelectList(ViewBag.CheqLIst, "Chq_id", "Chq_Name"), new { @class = "form-control", @id = "chklist", onchange = "javascript:return ckkreport()" })
@Html.ValidationMessageFor(model => model.Chq_Name, "", new { @class = "text-danger" })
</div>
</div>
<div class="dvPartialView">
</div>
</div>
}
@section Scripts{
<script>
function ckkreport() {
var drpvalue = document.getElementById("chklist").value;
$.ajax({
url: '@Url.Action("_Chklost", "Org")',
dataType: "html",
data: { "sb": drpvalue },
type: "GET",
contentType: "application/json",
success: function (response) {
alert(response.data);
$('#dvPartialView').html(response);
},
error: function (err) {
alert(err.responseText);
}
});
}
</script>
}
on view of this partial view
@model IEnumerable<Leisure_Mgmt.leisure_Repository.cheque_Detail>
@{
WebGrid grid = new WebGrid(Model);
}
<h2>Users</h2>
@grid.GetHtml(tableStyle: "table-design table table-bordered table-hover dataTable", fillEmptyRows: false,
columns: new[]
{
grid.Column(columnName:"Cheque_Number", header:"Cheque Number"),
grid.Column(columnName:"Cheque_Status", header:"Status")
})