473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Class instance problem

I am using the 2.0 App_Code folder to have a common, global class for every
aspx page to access and use. I need to have a common "MainTitle" string
variable to read/write and which finally the MasterPage PreRender event code
parses to decide if a page title should be rendered.
While I can instantiate this class in the MasterPage code it means that the
instance that the aspx pages access is a different one and so they are not
talking to each other. My question is - how can I have a common access to
this class instance, both from MasterPage and aspx pages?
Nov 17 '05 #1
4 1171
Session.

--

Derek Davis
dd******@gmail.com

"Daves" <db****@simnet.is> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am using the 2.0 App_Code folder to have a common, global class for every
aspx page to access and use. I need to have a common "MainTitle" string
variable to read/write and which finally the MasterPage PreRender event
code parses to decide if a page title should be rendered.
While I can instantiate this class in the MasterPage code it means that
the instance that the aspx pages access is a different one and so they are
not talking to each other. My question is - how can I have a common access
to this class instance, both from MasterPage and aspx pages?

Nov 17 '05 #2
NO I don't want to use session, I wan't to use memory resident class
properties!!

"carion1" <dd******@gmail.com> wrote in message
news:eH*************@TK2MSFTNGP10.phx.gbl...
Session.

--

Derek Davis
dd******@gmail.com

"Daves" <db****@simnet.is> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am using the 2.0 App_Code folder to have a common, global class for
every aspx page to access and use. I need to have a common "MainTitle"
string variable to read/write and which finally the MasterPage PreRender
event code parses to decide if a page title should be rendered.
While I can instantiate this class in the MasterPage code it means that
the instance that the aspx pages access is a different one and so they
are not talking to each other. My question is - how can I have a common
access to this class instance, both from MasterPage and aspx pages?


Nov 17 '05 #3
Session unless you want to dynamically re-write the code for the class in
the app_code folder. I could be wrong as I have limited exp with 2005.

--

Derek Davis
dd******@gmail.com

"Daves" <db****@simnet.is> wrote in message
news:OS**************@TK2MSFTNGP09.phx.gbl...
NO I don't want to use session, I wan't to use memory resident class
properties!!

"carion1" <dd******@gmail.com> wrote in message
news:eH*************@TK2MSFTNGP10.phx.gbl...
Session.

--

Derek Davis
dd******@gmail.com

"Daves" <db****@simnet.is> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am using the 2.0 App_Code folder to have a common, global class for
every aspx page to access and use. I need to have a common "MainTitle"
string variable to read/write and which finally the MasterPage PreRender
event code parses to decide if a page title should be rendered.
While I can instantiate this class in the MasterPage code it means that
the instance that the aspx pages access is a different one and so they
are not talking to each other. My question is - how can I have a common
access to this class instance, both from MasterPage and aspx pages?



Nov 17 '05 #4
if I understand this correctly the only way to do this would be to have the
properties static? If so, wouldn't that be prone to errors since every user
session could change the property values, before the page cycle has finished
running?

"carion1" <dd******@gmail.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Session unless you want to dynamically re-write the code for the class in
the app_code folder. I could be wrong as I have limited exp with 2005.

--

Derek Davis
dd******@gmail.com

"Daves" <db****@simnet.is> wrote in message
news:OS**************@TK2MSFTNGP09.phx.gbl...
NO I don't want to use session, I wan't to use memory resident class
properties!!

"carion1" <dd******@gmail.com> wrote in message
news:eH*************@TK2MSFTNGP10.phx.gbl...
Session.

--

Derek Davis
dd******@gmail.com

"Daves" <db****@simnet.is> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am using the 2.0 App_Code folder to have a common, global class for
every aspx page to access and use. I need to have a common "MainTitle"
string variable to read/write and which finally the MasterPage PreRender
event code parses to decide if a page title should be rendered.
While I can instantiate this class in the MasterPage code it means that
the instance that the aspx pages access is a different one and so they
are not talking to each other. My question is - how can I have a common
access to this class instance, both from MasterPage and aspx pages?



Nov 17 '05 #5

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

Similar topics

1
by: Murat Tasan | last post by:
hi, i am having a small problem with constructing an inner class. i am using an inner class (and not a static nested class) because the methods of the inner class need access to the enclosing...
7
by: Rim | last post by:
Hi, It appears to me the simplest way to add a function to a class outside of the class declaration is as follows: >>> class a(object): .... pass .... >>> def f(self): .... print 'hi'
8
by: Mark English | last post by:
I'd like to write a Tkinter app which, given a class, pops up a window(s) with fields for each "attribute" of that class. The user could enter values for the attributes and on closing the window...
166
by: Graham | last post by:
This has to do with class variables and instances variables. Given the following: <code> class _class: var = 0 #rest of the class
10
by: Opa | last post by:
I have tried for two days to solve this problem with no luck. I have a singleton class which has some events declared. When I inherit from this class the events don't seem to come along with it....
21
by: Mark Broadbent | last post by:
Consider the following statements //------- Item i = Basket.Items; //indexer is used to return instance of class Item Basket.Items.Remove(); //method on class item is fired item i = new...
7
by: jsale | last post by:
I have made an ASP.NET web application that connects to SQL Server, reading and writing data using classes. I was recommended to use session objects to store the data per user, because each user...
29
by: Michael D. Ober | last post by:
Is there any way to create a constant in a class that can be used both with an instantiated object and without. For example: dim ClassConst as string = myClass.ConstantString dim myObj = new...
26
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is...
20
by: tshad | last post by:
Using VS 2003, I am trying to take a class that I created to create new variable types to handle nulls and track changes to standard variable types. This is for use with database variables. This...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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...

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.