English 中文(简体)
Ajax paging, wrong conduct after page复读
原标题:Ajax paging, incorrect behavior after page refresh

我的桌子是用麻.的,可以选择任何页数和浏览数据,但如果在我的浏览器上进行新闻复读,则显示一页。 如何在复读后留在同一页上?

这里是法典的一部分。

@using (Ajax.BeginForm(new AjaxOptions() { UpdateTargetId = "users_rows", Url = Url.Action("UsersRows") }))
    {
        <table>
            <thead>
            <tr>
                <th>@Resources.Id</th>
                <th>@Resources.Login</th>
                <th>@Resources.Password</th>
                <th>@Resources.FirstName</th>
                <th>@Resources.LastName</th>
                <th>@Resources.Birthday</th>
                <th>@Resources.IsActive</th>
                <th>@Resources.Role</th>
                <th>@Resources.RegistrationDate</th>
            </tr>
            </thead>
            <tbody id="users_rows">
                @Html.Partial("UsersRows", Model)
            </tbody>
        </table>
    }
    @Html.Partial("Pager", Model)

页: 1

@model UserManagmentStudio.Domain.IPager

@if (Model.PageCount > 1)
{
    for (Int32 i = 1; i <= Model.PageCount; i++)
    {
        @Ajax.ActionLink(i.ToString(), "Index", new {page = i},
            new AjaxOptions()
           {
               UpdateTargetId = "users_rows",
               Url = Url.Action("UsersRows", new { page = i }),
           }
        )
        @:&nbsp
    }

}
最佳回答

无法做到这一点,因为你正在利用美国宇宙航空研究开发机构进行想象,因此永远不会重载本页。 如果你取消AJAX的电话,并全心全意地对你的主食进行反馈,那么浏览器的长度将予以更新,如果用户点击代码<><kbd>F5</kbd>,他将不会放松目前网页的轨道,因为它将成为查询的一部分。

问题回答

当你复读时,这又回到了你的违约行为。 您可以把目前用户的网页储存在一个 co子里,然后将其作为参数传送到你的网页上。 你们必须储存每个独特的页面用户访问的厨师,因为它没有包含页数,因为页数相同。 好事是,你不需要在用户离开后保持 co。

除此之外,没有办法这样做。





相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

热门标签