Link to home
Start Free TrialLog in
Avatar of aothomas42
aothomas42Flag for United States of America

asked on

ASP.Net Profiles/Session Variables

So i'm trying to move away from Session Variables. In this site I am trying to optimize it uses too many of them. I have been looking into using ASP.Net Profiles instead. I have this example I found but can't seem to get it to work for me. Am hoping someone has seen it or something like it and knows what I can do get it working.

http://www.asp.net/downloads/sandbox/table-profile-provider-samples

In the default.aspx file in the page_load event the below line gives me the error
'The name 'Profile' does not exist in the current context'

txtFirstName.Text = Profle.FirstName;
Avatar of aothomas42
aothomas42
Flag of United States of America image

ASKER

Also if anyone has a better alternative to session variables other than profiles i'd love ot hear it
Avatar of Deepak Vasudevan
Session itself is not bad. I would suggest the following.

1) Have a disciplined session variables which are serializable so that they can be used with Inproc, StateServer and SqlServer.

2) Instead of storing just any variable, group those into the modules struct and then save it in the session.
Currently I am using Inproc and i believe this is what is causing the worker process to recycle so quickly. I am thinking of using State or SqlServer.

Could you explain your second part a little further
ASKER CERTIFIED SOLUTION
Avatar of Anuradha Goli
Anuradha Goli
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Problem might be because of back up copy from the same file (copy of default.aspx) that you need  to exclude from the project.