Avatar of aothomas42
Flag 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.


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;
ASP.NETC#.NET Programming

Avatar of undefined
Last Comment
Anuradha Goli

8/22/2022 - Mon

Also if anyone has a better alternative to session variables other than profiles i'd love ot hear it
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
Your help has saved me hundreds of hours of internet surfing.
Anuradha Goli

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Anuradha Goli

Problem might be because of back up copy from the same file (copy of default.aspx) that you need  to exclude from the project.
Anuradha Goli