Error: "The viewstate is invalid for this page and might be corrup

Discussion in 'ASP .Net' started by =?Utf-8?B?QmFydG9zeiBLcnp5d2lja2k=?=, Jun 29, 2004.

  1. I have a problem with the following error:

    "Server Error in '/sir' Application.
    --------------------------------------------------------------------------------

    The viewstate is invalid for this page and might be corrupted.
    "
    Page properties are: EnableViewState="True" EnableViewStateMac="False"
    I don't have a Web Farm.
    I want to keep DataSet in ViewState, so in Page_Load i load some data and save them in the ViewState.
    But when I push some button, error occurs in OnInit method in line "base.OnInit(e);"

    How can I solve this problem ?
     
    =?Utf-8?B?QmFydG9zeiBLcnp5d2lja2k=?=, Jun 29, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?QmFydG9zeiBLcnp5d2lja2k=?=

    Hans Kesting Guest

    "Bartosz Krzywicki" <> wrote in message
    news:...
    > I have a problem with the following error:
    >
    > "Server Error in '/sir' Application.
    > --------------------------------------------------------------------------------
    >
    > The viewstate is invalid for this page and might be corrupted.
    > "
    > Page properties are: EnableViewState="True" EnableViewStateMac="False"
    > I don't have a Web Farm.
    > I want to keep DataSet in ViewState, so in Page_Load i load some data and save them in the ViewState.
    > But when I push some button, error occurs in OnInit method in line "base.OnInit(e);"
    >
    > How can I solve this problem ?


    What exactly do you do? Just a page that posts back to itself, or are there
    server.executes, server.transfers or http-handlers involved?

    You did set EnableViewStateMac to false, which is the solution
    for some of these problems, but apparently not for you.

    Why do you want to keep a dataset in viewstate? This will mean that that
    entire dataset is transported from the server to the client,
    and again from client to server! How big is it?

    There are several possibilities to store it server-side (session, cache).


    Hans Kesting
     
    Hans Kesting, Jun 29, 2004
    #2
    1. Advertising

  3. Re: Error: "The viewstate is invalid for this page and might be co

    > What exactly do you do? Just a page that posts back to itself, or are there
    > server.executes, server.transfers or http-handlers involved?


    I post back to itself, and I have http-handlers involved

    > Why do you want to keep a dataset in viewstate? This will mean that that
    > entire dataset is transported from the server to the client,
    > and again from client to server! How big is it?
    >
    > There are several possibilities to store it server-side (session, cache).
    >


    DataSet isn't big, but I realized (as you said) that keeping it in viewstate isn't good idea, and now I store it in Session. To save DataSet in ViewState you must save it as XML, and than you loose same informations like primary keys, constraints etc.
    In Session I can store entire object.
    Thanks for answer :)
     
    =?Utf-8?B?QmFydG9zeiBLcnp5d2lja2k=?=, Jun 30, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gordon Moore
    Replies:
    0
    Views:
    447
    Gordon Moore
    Jun 27, 2003
  2. Hardy Wang
    Replies:
    5
    Views:
    367
    Hardy Wang
    Jul 4, 2003
  3. Trevor Andrew
    Replies:
    0
    Views:
    479
    Trevor Andrew
    Jul 25, 2003
  4. Anatoly
    Replies:
    4
    Views:
    402
    Anatoly
    Nov 12, 2003
  5. Jason
    Replies:
    7
    Views:
    1,381
    =?Utf-8?B?UmFqaXY=?=
    Oct 13, 2004
Loading...

Share This Page