Losing viewstate in custom control

Discussion in 'ASP .Net Building Controls' started by William, Dec 4, 2003.

  1. William

    William Guest

    I have a custom control I derived from the datagrid control and set a
    couple of values in viewstate("foo") = "bar" but on postback they are
    nothing. I have seen an example of doing this in the O'Reilly book
    "Programming asp.net" pg 645. I must be missing something. Any help
    would be greatly appreciated.
    William, Dec 4, 2003
    #1
    1. Advertising

  2. William

    Teemu Keiski Guest

    What's the code you are trying? Post some more.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist


    "William" <> wrote in message
    news:...
    > I have a custom control I derived from the datagrid control and set a
    > couple of values in viewstate("foo") = "bar" but on postback they are
    > nothing. I have seen an example of doing this in the O'Reilly book
    > "Programming asp.net" pg 645. I must be missing something. Any help
    > would be greatly appreciated.
    Teemu Keiski, Dec 5, 2003
    #2
    1. Advertising

  3. I was putting together a simple example to post when I figured out what
    I did. I had moved the order of the control in the controls collection
    by adding other child controls. I guess viewstate is assigned based on
    that order.

    I am having another interesting viestate issue know where I can add
    somthing to viewstate on the first load of the control but on post back
    I cannot update viewstate. Is that how it works. Also I noticed that
    when an onclick event fires for another derived control I am using
    viewstate isn't available at that point yet. Any ideas? Thanks for
    your help.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    William French, Dec 5, 2003
    #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. Replies:
    0
    Views:
    1,849
  2. Replies:
    0
    Views:
    612
  3. PJ6
    Replies:
    1
    Views:
    561
  4. Ken Varn
    Replies:
    0
    Views:
    110
    Ken Varn
    Aug 22, 2005
  5. Jason C
    Replies:
    4
    Views:
    666
    Morty Abzug
    Jun 26, 2012
Loading...

Share This Page