How can I use/share global variables and objects in an ASP.NET application 
Author Message
 How can I use/share global variables and objects in an ASP.NET application

Hi there,

What's the best method to share global variables and objects, like DataSets
or DataTables between some ASP.NET pages with user- controls in an ASP.NET
application? They had to be separated for the usersession. For session
management I use the built in method of ASP.NET with SQL- Server and
cookieless mode. Is there an other method as to use the Session-object?

I have tried to use public declaration in my usercontrols and to use public
properties. But if I try to reference them, they are not accessible. But I
don't know, if I have cast them in the right way.
I have an aspx-page with a usercontrol. A user can make some action in this
page and then a new aspx-page is called with other usercontrols. I want to
read some values out of the first usercontrol in the second usercontrol in
the new aspx-page. Therefore I look for the best way.

Thanks!



Sun, 28 Nov 2004 00:15:00 GMT  
 How can I use/share global variables and objects in an ASP.NET application
Adi,

    You might want to consider using the Application object, storing
everything there, as this object is persisted across sessions.  However, if
you have a web farm, it will be a little more difficult.

    Hope this helps.

--
               - Nicholas Paldino [.NET MVP]

Quote:

> Hi there,

> What's the best method to share global variables and objects, like
DataSets
> or DataTables between some ASP.NET pages with user- controls in an ASP.NET
> application? They had to be separated for the usersession. For session
> management I use the built in method of ASP.NET with SQL- Server and
> cookieless mode. Is there an other method as to use the Session-object?

> I have tried to use public declaration in my usercontrols and to use
public
> properties. But if I try to reference them, they are not accessible. But I
> don't know, if I have cast them in the right way.
> I have an aspx-page with a usercontrol. A user can make some action in
this
> page and then a new aspx-page is called with other usercontrols. I want to
> read some values out of the first usercontrol in the second usercontrol in
> the new aspx-page. Therefore I look for the best way.

> Thanks!



Sun, 28 Nov 2004 00:30:50 GMT  
 How can I use/share global variables and objects in an ASP.NET application
Nicholas,

the variables and objects should be just valid in the session not for the
whole application.

Adi



Quote:
> Adi,

>     You might want to consider using the Application object, storing
> everything there, as this object is persisted across sessions.  However,
if
> you have a web farm, it will be a little more difficult.

>     Hope this helps.

> --
>                - Nicholas Paldino [.NET MVP]




Quote:
> > Hi there,

> > What's the best method to share global variables and objects, like
> DataSets
> > or DataTables between some ASP.NET pages with user- controls in an
ASP.NET
> > application? They had to be separated for the usersession. For session
> > management I use the built in method of ASP.NET with SQL- Server and
> > cookieless mode. Is there an other method as to use the Session-object?

> > I have tried to use public declaration in my usercontrols and to use
> public
> > properties. But if I try to reference them, they are not accessible. But
I
> > don't know, if I have cast them in the right way.
> > I have an aspx-page with a usercontrol. A user can make some action in
> this
> > page and then a new aspx-page is called with other usercontrols. I want
to
> > read some values out of the first usercontrol in the second usercontrol
in
> > the new aspx-page. Therefore I look for the best way.

> > Thanks!



Sun, 28 Nov 2004 00:37:51 GMT  
 How can I use/share global variables and objects in an ASP.NET application
Then use the Session object

Quote:

> Nicholas,

> the variables and objects should be just valid in the session not for the
> whole application.

> Adi


wrote

> > Adi,

> >     You might want to consider using the Application object, storing
> > everything there, as this object is persisted across sessions.  However,
> if
> > you have a web farm, it will be a little more difficult.

> >     Hope this helps.

> > --
> >                - Nicholas Paldino [.NET MVP]



> > > Hi there,

> > > What's the best method to share global variables and objects, like
> > DataSets
> > > or DataTables between some ASP.NET pages with user- controls in an
> ASP.NET
> > > application? They had to be separated for the usersession. For session
> > > management I use the built in method of ASP.NET with SQL- Server and
> > > cookieless mode. Is there an other method as to use the
Session-object?

> > > I have tried to use public declaration in my usercontrols and to use
> > public
> > > properties. But if I try to reference them, they are not accessible.
But
> I
> > > don't know, if I have cast them in the right way.
> > > I have an aspx-page with a usercontrol. A user can make some action in
> > this
> > > page and then a new aspx-page is called with other usercontrols. I
want
> to
> > > read some values out of the first usercontrol in the second
usercontrol
> in
> > > the new aspx-page. Therefore I look for the best way.

> > > Thanks!



Sun, 28 Nov 2004 02:33:43 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. how to create c#, asp.net application without global.asa*

2. Global Variables in Shared Objects

3. Can not create web application (ASP.NET using C#)

4. Accessing ASP(not ASP.Net) built-in objects with C#

5. Using Application[] in ASP.Net

6. ALT/MTS COM used as ASP application level object

7. ASP.NET application with Windows.NET RC1

8. ASP.NET and Global class

9. How to call VB.net and ASP.net programs in MFC?(or,asp call vc)

10. Share CObArray Object using DLL Section share method

11. Global Object In Application Object File

12. Strange Global Error In ASP.NET

 

 
Powered by phpBB® Forum Software