ورود

View Full Version : مبتدی: استفاده از webgrid



hadinajafi
یک شنبه 11 بهمن 1394, 14:33 عصر
سلام کد زیر رو برای paging کنترل webgrid با استفاده از ajax نوشتم ولی کار نمی کنه میشه راهنمایی کنید مشگل کجاست؟

@model IEnumerable<Portal.Areas.Administrator.Models.ostan>

@{

var grid = new WebGrid(source: Model, canPage: true, rowsPerPage: 10, canSort: true, ajaxUpdateContainerId: "grid");
grid.Pager(WebGridPagerModes.All);
ViewBag.Title = "Index";

}

<section class="wrapper">
<div class="row">
<div class="col-lg-12">
<section class="panel">
<header class="panel-heading">
لیست استان ها @Ajax.ActionLink(HtmlTextWriter.SpaceChar + "تعریف استان جدید ", "Create", null, options, htmlAttributes: new { @class = "createButon btn btn-success btn-sm fa fa-plus-square" })
</header>
@{

@grid.GetHtml(htmlAttributes: new { id = "grid", @class = "table table-striped table-advance table-hover" }, columns: grid.Columns(

grid.Column("master", header: "مسئول"),
grid.Column("master_mobile", header: "تلفن همراه مسئول"),
grid.Column("address", header: "آدرس"),
grid.Column("zipcode", header: "کدپستی"),
grid.Column("tel", header: "تلفن ثابت"),
grid.Column("", header: "", format: @<text><div class="btn-group">@Html.ActionLink(" ", "Delete", new { id = item.id }, htmlAttributes: new { @class = "btn btn-danger fa fa-trash-o ", target = "_blank" })@Html.ActionLink(" ", "Edit", new { id = item.ID }, htmlAttributes: new { @class = "btn btn-primary fa fa-pencil-square-o", target = "_blank" })@Html.ActionLink(" ", "Details", new { id = item.ID }, htmlAttributes: new { @class = "btn btn-success fa fa-info-circle", target = "_blank" })</div></text>)));
}


</section>
</div>
</div>
</section>


<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>


وقتی میری صفحه بعد صفحه refresh میشه