PC Review


Reply
Thread Tools Rate Thread

Class instance problem

 
 
Daves
Guest
Posts: n/a
 
      24th Sep 2005
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?


 
Reply With Quote
 
 
 
 
carion1
Guest
Posts: n/a
 
      25th Sep 2005
Session.

--

Derek Davis
(E-Mail Removed)

"Daves" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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?
>



 
Reply With Quote
 
Daves
Guest
Posts: n/a
 
      25th Sep 2005
NO I don't want to use session, I wan't to use memory resident class
properties!!

"carion1" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Session.
>
> --
>
> Derek Davis
> (E-Mail Removed)
>
> "Daves" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>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?
>>

>
>



 
Reply With Quote
 
carion1
Guest
Posts: n/a
 
      25th Sep 2005
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
(E-Mail Removed)

"Daves" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> NO I don't want to use session, I wan't to use memory resident class
> properties!!
>
> "carion1" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Session.
>>
>> --
>>
>> Derek Davis
>> (E-Mail Removed)
>>
>> "Daves" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>>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?
>>>

>>
>>

>
>



 
Reply With Quote
 
Daves
Guest
Posts: n/a
 
      26th Sep 2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
> (E-Mail Removed)
>
> "Daves" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> NO I don't want to use session, I wan't to use memory resident class
>> properties!!
>>
>> "carion1" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Session.
>>>
>>> --
>>>
>>> Derek Davis
>>> (E-Mail Removed)
>>>
>>> "Daves" <(E-Mail Removed)> wrote in message
>>> news:%(E-Mail Removed)...
>>>>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?
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Instance of derived class does not show public methods or properties that are not in the inherited class D Witherspoon Microsoft Dot NET 5 28th Mar 2006 11:25 PM
Instance of derived class does not show public methods or properties that are not in the inherited class D Witherspoon Microsoft VB .NET 5 28th Mar 2006 11:25 PM
Creating a subclass instance from a base class instance Larry Lard Microsoft VB .NET 2 28th Jan 2005 05:48 PM
Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class. DJ Dev Microsoft ASP .NET 3 8th Feb 2004 04:19 PM
RE: VB .NET BUG: IntelliSense shows protected members of class instance in derived class Benjamin Wulfe Microsoft Dot NET Compact Framework 0 28th Jul 2003 11:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:18 AM.