473,508 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with public properties

I really dont know what I should do. I am asking for best practices.

currently I create my properties by doing this.

Context.Items.Add("Info", new Info(Request.QueryString["acct"],
Request.QueryString["option"]));

Info is a class that I call that places all data retrieved from a db
into public properties.

I get the data by:

Info my = (Info) HttpContext.Current.Items["Info"];

but as you all know this does not work because Context is for current
request.

I have multiple tabs and I bring all my data in at the beginning and
then by using public properties I populate the different tabs.

What can I do that will ensure I am able to retrieve my public
properties for each tab. I'm sure I need to use session but I am not
sure the best way.
Please help,
Thanks pietaster
Nov 18 '05 #1
2 1150
Well if you have same tabs for all users then its a waste using Session to
store the data for you to retrieve from.
Application used the common place for global data dump in ASP days.... but
now you have a more flexible Cache object. If you want to store
anything...,. cache is the place...
You can still use Application but if it starts running out of memory... it
causes the applicaiton to restart... on the other hand cache is smarter.. it
just starts chucking things out based on it priority settings...

hope this helps....

--
Regards,

HD

"pietaster" <co******@yahoo.com> wrote in message
news:bd**************************@posting.google.c om...
I really dont know what I should do. I am asking for best practices.

currently I create my properties by doing this.

Context.Items.Add("Info", new Info(Request.QueryString["acct"],
Request.QueryString["option"]));

Info is a class that I call that places all data retrieved from a db
into public properties.

I get the data by:

Info my = (Info) HttpContext.Current.Items["Info"];

but as you all know this does not work because Context is for current
request.

I have multiple tabs and I bring all my data in at the beginning and
then by using public properties I populate the different tabs.

What can I do that will ensure I am able to retrieve my public
properties for each tab. I'm sure I need to use session but I am not
sure the best way.
Please help,
Thanks pietaster

Nov 18 '05 #2
Check out the Cache object -- it is the new replacement for the older
Application collection in ASP.

Cache supports many methods of storing data smartly (like cache timeouts,
refreshes, etc..) and shares data across sessions.
--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).
--------------------
From: co******@yahoo.com (pietaster)
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: problems with public properties
Date: 30 Dec 2003 09:44:03 -0800
Organization: http://groups.google.com
Lines: 27
Message-ID: <bd**************************@posting.google.com >
NNTP-Posting-Host: 159.53.206.142
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1072806244 7344 127.0.0.1 (30 Dec 2003 17:44:04 GMT)X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Tue, 30 Dec 2003 17:44:04 +0000 (UTC)
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!cpmsftng xa09.phx.gbl!TK2MSFTNGP08.
phx.gbl!newsfeed00.sul.t-online.de!t-online.de!npeer.de.kpn-eurorings.net!ne
ws.tele.dk!news.tele.dk!small.news.tele.dk!news.ma xwell.syr.edu!postnews1.go
ogle.com!not-for-mailXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:198908
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

I really dont know what I should do. I am asking for best practices.

currently I create my properties by doing this.

Context.Items.Add("Info", new Info(Request.QueryString["acct"],
Request.QueryString["option"]));

Info is a class that I call that places all data retrieved from a db
into public properties.

I get the data by:

Info my = (Info) HttpContext.Current.Items["Info"];

but as you all know this does not work because Context is for current
request.

I have multiple tabs and I bring all my data in at the beginning and
then by using public properties I populate the different tabs.

What can I do that will ensure I am able to retrieve my public
properties for each tab. I'm sure I need to use session but I am not
sure the best way.
Please help,
Thanks pietaster


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1457
by: Gastin | last post by:
I am digesting a web serivce from Amazon.Com. I have the following class which was autogenerated by VS.NET when I created a Web Reference to...
17
2453
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control...
2
3157
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
1
1688
by: Sky Sigal | last post by:
(PS: Cross post from microsoft.pulic.dotnet.framework.aspnet.webcontrols) I've been looking lately for a way to keep the Properties panel for Controls 'clean'... My goal is to keep similar...
3
2387
by: Nathan | last post by:
Somebody help please, I am desperate for help as I've battled this problem for 3 days now! :( I have an application (NT Service) that uses 2 threads... one worker-thread (i.e. always running)...
3
1110
by: Jon Turner | last post by:
I have an asynchronous call to a remote procedure that is invoked thru BeginInvoke. The problem is that in the Delegate if I throw an event before the CallBack function exits, the CallBack will...
8
2668
by: per9000 | last post by:
Dear readers, I have some problems with strong keys. What I want to do is basically this. A - create an application (f.x. strongHello.dll) with a strong key. B - import the functions of this...
5
1334
by: Thomas Lorenz | last post by:
Hi I have a class Person and a class Student which inherits from Person. Each class should have a method which copies the properties from another Person or Student respectively. The copy-method...
1
1745
by: shapper | last post by:
Hello, I have the following class to be used in profile: <Serializable()_ Public Class Options Inherits ProfileBase Private _Newsletter As Boolean Public Property Newsletter() As Boolean
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.