Keeping ViewState in SessionPageStatePersister

后端 未结 4 1432
情书的邮戳
情书的邮戳 2020-12-16 01:52

I want to keep viewstate of a specific page in session but following code block does not help me, what might I be missing?

So here is the code-behind file content of

4条回答
  •  爱一瞬间的悲伤
    2020-12-16 02:15

    The important part of the code is

    protected override PageStatePersister PageStatePersister
    {
        get
        {
            return new SessionPageStatePersister(this);
        }
    }
    

    This overrides the normal page state persister and provides one that persists the page data to the Session instead of the ViewState.

提交回复
热议问题