AJAX and State Maintenance

Discussion in 'ASP .Net' started by Scott McNair, Dec 9, 2008.

  1. Scott McNair

    Scott McNair Guest

    I'm using VS2008 with the built-in "Atlas" AJAX controls. I've got a class
    entitled WebAccount which stores a user's credentials (UserID, email, etc);
    however it loses its information every time AJAX issues a post. What's the
    easiest way to maintain state so that I don't lose this information?

    Regards,
    Scott
     
    Scott McNair, Dec 9, 2008
    #1
    1. Advertising

  2. Scott McNair

    George Guest

    Session object.
    You can do
    Session["webaccount"] = myWebAccount;
    WebAccount myWebAccount = Session["webaccount"];



    George.

    "Scott McNair" <> wrote in message
    news:Xns9B6F90639A160donquixote235gmailco@207.46.248.16...
    > I'm using VS2008 with the built-in "Atlas" AJAX controls. I've got a
    > class
    > entitled WebAccount which stores a user's credentials (UserID, email,
    > etc);
    > however it loses its information every time AJAX issues a post. What's
    > the
    > easiest way to maintain state so that I don't lose this information?
    >
    > Regards,
    > Scott
     
    George, Dec 9, 2008
    #2
    1. Advertising

  3. Scott McNair

    gerry Guest

    well, you can try but what will actually work is :

    Session["webaccount"] = myWebAccount;
    WebAccount myWebAccount = Session["webaccount"] as WebAccount;


    "George" <> wrote in message
    news:...
    > Session object.
    > You can do
    > Session["webaccount"] = myWebAccount;
    > WebAccount myWebAccount = Session["webaccount"];
    >
    >
    >
    > George.
    >
    > "Scott McNair" <> wrote in message
    > news:Xns9B6F90639A160donquixote235gmailco@207.46.248.16...
    >> I'm using VS2008 with the built-in "Atlas" AJAX controls. I've got a
    >> class
    >> entitled WebAccount which stores a user's credentials (UserID, email,
    >> etc);
    >> however it loses its information every time AJAX issues a post. What's
    >> the
    >> easiest way to maintain state so that I don't lose this information?
    >>
    >> Regards,
    >> Scott

    >
     
    gerry, Dec 9, 2008
    #3
  4. Scott McNair

    Scott McNair Guest

    "gerry" <> wrote in news:ufejT3jWJHA.4168
    @TK2MSFTNGP06.phx.gbl:

    > well, you can try but what will actually work is :
    >
    > Session["webaccount"] = myWebAccount;
    > WebAccount myWebAccount = Session["webaccount"] as WebAccount;


    Thanks, that did the trick.

    I'd actually tried the Session object, but it wasn't working for me. Turns
    out it was a simple "Page.IsPostBack" that I wasn't trapping for. D'oh is
    me!
     
    Scott McNair, Dec 9, 2008
    #4
    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. Jeff S
    Replies:
    1
    Views:
    324
    Natty Gur
    Nov 4, 2003
  2. =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=

    Help on maintenance state information ???

    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Sep 13, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    366
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=
    Sep 13, 2005
  3. minnie
    Replies:
    1
    Views:
    737
    Andrew Thompson
    Dec 13, 2006
  4. Jeremy S.

    Wizard Design and State Maintenance

    Jeremy S., Jul 27, 2009, in forum: ASP .Net
    Replies:
    12
    Views:
    714
    Gregory A. Beamer
    Jul 28, 2009
  5. ewolfman

    Multiview, server controls and state maintenance

    ewolfman, Oct 17, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    172
    ewolfman
    Oct 17, 2005
Loading...

Share This Page