从单个Controller操作错误返回多个部分视图:重复查看

时间:2013-10-30 13:01:29

标签: asp.net-mvc

我需要从Ajax调用更新Multiple。我使用这个页面:Returning Multiple partial views from single Controller action?但重复约会!!为什么?

我的代码在视图中:

    @using (Ajax.BeginForm("Information", "Classes",
                            new AjaxOptions
                            {
                                HttpMethod = "get"
                            }))
{

        <select id="dropDownDisplay">
            <option>10</option>
            <option>20</option>
            <option>30</option>
        </select>
     <div id="grid">
        @{ Html.RenderPartial("_ClassesList", Model); }
    </div>

    <div id="PagingList">
        @{Html.RenderPartial("_PageNumbers", Model.Page);}
    </div>
}

我在控制器中的代码:

公共ActionResult信息()         {

        var page = new Page();
       // Get Info Page...
        var myService = new ClassesService();

        var viewModelClasses= new ViewModelClasses();

        viewModelClasses.Classeses = myService.All();

        viewModelClasses.Page = page;


        return View(viewModelClasses);
    }

我的观看模式:

 public class ViewModelClasses
{
    public IList<Classes> Classeses { get; set; }
    public Page Page { get; set; }
}

输出当我转到下一页时:

enter image description here

0 个答案:

没有答案