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

Avatar of undefined
Last Comment
Anuradha Goli
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.
Avatar of aothomas42
aothomas42
Flag of United States of America image

ASKER

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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Anuradha Goli
Anuradha Goli
Flag of Ireland image

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

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo