Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6868539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:26:48+00:00 2026-05-27T03:26:48+00:00

I am trying to make a strongly typed viewstate object. public class MyNewPage :

  • 0

I am trying to make a strongly typed viewstate object.

public class MyNewPage : ViewStatePage<MyNewPageViewStateStore>

In the implementation of ViewStatePage, I am instantiating an object Store out of this.ViewState["_PageViewState"]. In the derived page, I’ll be using that object and making changes to it.

What’s the last event called in an asp.net page that can still affect View State?
Is it Unload?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:26:48+00:00Added an answer on May 27, 2026 at 3:26 am

    In the ASP.net page lifecycle the order goes (this is the short version):

    Preinit -> Init -> Load Viewstate -> Page Load -> Events -> PreRender ->
    Save Viewstate -> Render -> Unload

    Places where changes to viewstate are persisted in Bold. As a result the last chance you have to modify viewstate and have it persisted is PreRender (technically you could handle SaveViewState and that would be your last chance to modify viewstate and have it saved).

    MSDN: http://msdn.microsoft.com/en-us/library/ms178472.aspx#additional_page_life_cycle_considerations

    Handling SaveViewState:

    public partial class MyPage: System.Web.UI.Page
    {
        protected override object SaveViewState()
        {
            // manipulate viewstate objects here -- Last Chance
            return base.SaveViewState();
        }
    
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a strongly-typed Dictionary class in VB.NET. I'm tired of typing
i'm trying to make my site master page ( views/shared/site.master ) strongly typed. eg.
I'm trying to make a repository class that has a method to order the
Why can't I use this interface to create a strongly typed view? public interface
I'm trying to use an Html.RenderAction in a strongly typed nature from the MVC
I'm trying to create a strongly typed view model as John Sheehan suggests here
I'm trying to create a strongly typed partial view <%@ Page Title= Language=C# MasterPageFile=~/Views/Shared/Site.Master
Trying to make some experiments with Spring MVC and Spring Security: @Controller @RequestMapping(/auth) public
I am trying make long screen to vertical direction. So, I need a screen
Trying to make a custom :confirm message for a rails form that returns data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.