AJAX and State Maintenance

S

Scott McNair

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
 
G

George

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



George.
 
G

gerry

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

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


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



George.

Scott McNair said:
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
 
S

Scott McNair

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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top