1

在我的场景中,我需要维护差异页面的状态。例如排序,网格视图的分页。当用户导航到另一个页面时,他们会返回到 gridview 页面。他们将看到 Grid 具有相同的分页/排序/过滤他们之前离开页面的内容。

我找到了一个解决方案:

http://www.codeproject.com/Articles/18445/Maintaining-State-Per-Page-in-ASP-NET-Web-Applic

但我真的不明白编码。

这是我不明白的部分?

protected override void OnPreRender(EventArgs e)
    {
        if (System.Web.HttpContext.Current != null)
        {
            PullStated();
            PageState.SetPageState(this, this.PageState);
        }

        base.OnPreRender(e);
    }


 protected virtual void PullStated()
    {
    }

为什么内部 PullStated() 方法是空的?PullStated() 的目的是什么?

4

0 回答 0