473,385 Members | 1,593 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.

server side object tags in global.asax

I am developing an asp.net app based on a previous asp application.

in the asp applications global.asa file I had several

<object id="id" runat="server" scope="scope" class="comclass"> tags for
objects that the app used to speed up some global level data access and
functionality.

I have recoded the class libraries in .net and would like to acomplish the
same functionality in asp.net.

in examples I have seen you can still use the
<object id="id" runat="server" scope="scope" class="Class Name">
tags in global.asax but all these examples seem not to use the codebehind
model where the global.asax file contains the class definition for global:

Public Class Global
Inherits System.Web.HttpApplication
....

how do I create my applcation level objects and how do I access them in a
webform using the new model?

thx
--
randyr
Nov 19 '05 #1
15 2446
> how do I create my applcation level objects and how do I access them in a
webform using the new model?
This is probably going to sound crass, and I'm certainly used to being
called by that characterization, BUT...

1. Learn Object-oriented programming concepts
2. Learn the ASP.Net object model
3. Evaluate your requirements in the light of an OOP, ASP.Net application
4. Design your object model using the principles of OOP
5. Write your app

Here's why: ASP.Net and ASP have very little in common when it comes to
methodology. ASP is procedural. ASP.Net is object-oriented. ASP is extremely
limited. ASP.Net is unlimited. ASP has little or no programming model.
ASP.Net has a highly structured programming model.

In other words, just trying to "translate" ASP into ASP.Net is an exercise
in futility. You might succeed, but you'll regret it for the lifetime of
your application. Rather than translate, I would strongly suggest
re-engineering.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:9E**********************************@microsof t.com...I am developing an asp.net app based on a previous asp application.

in the asp applications global.asa file I had several

<object id="id" runat="server" scope="scope" class="comclass"> tags for
objects that the app used to speed up some global level data access and
functionality.

I have recoded the class libraries in .net and would like to acomplish the
same functionality in asp.net.

in examples I have seen you can still use the
<object id="id" runat="server" scope="scope" class="Class Name">
tags in global.asax but all these examples seem not to use the codebehind
model where the global.asax file contains the class definition for global:

Public Class Global
Inherits System.Web.HttpApplication
...

how do I create my applcation level objects and how do I access them in a
webform using the new model?

thx
--
randyr

Nov 19 '05 #2
Oh I have re-engineered using oop. I would still like to have an application
level complex object that I store application level data,collections... that
was the real question.

"Kevin Spencer" wrote:
how do I create my applcation level objects and how do I access them in a
webform using the new model?


This is probably going to sound crass, and I'm certainly used to being
called by that characterization, BUT...

1. Learn Object-oriented programming concepts
2. Learn the ASP.Net object model
3. Evaluate your requirements in the light of an OOP, ASP.Net application
4. Design your object model using the principles of OOP
5. Write your app

Here's why: ASP.Net and ASP have very little in common when it comes to
methodology. ASP is procedural. ASP.Net is object-oriented. ASP is extremely
limited. ASP.Net is unlimited. ASP has little or no programming model.
ASP.Net has a highly structured programming model.

In other words, just trying to "translate" ASP into ASP.Net is an exercise
in futility. You might succeed, but you'll regret it for the lifetime of
your application. Rather than translate, I would strongly suggest
re-engineering.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:9E**********************************@microsof t.com...
I am developing an asp.net app based on a previous asp application.

in the asp applications global.asa file I had several

<object id="id" runat="server" scope="scope" class="comclass"> tags for
objects that the app used to speed up some global level data access and
functionality.

I have recoded the class libraries in .net and would like to acomplish the
same functionality in asp.net.

in examples I have seen you can still use the
<object id="id" runat="server" scope="scope" class="Class Name">
tags in global.asax but all these examples seem not to use the codebehind
model where the global.asax file contains the class definition for global:

Public Class Global
Inherits System.Web.HttpApplication
...

how do I create my applcation level objects and how do I access them in a
webform using the new model?

thx
--
randyr


Nov 19 '05 #3
If you've studied up on OOP and ASP.Net, then you should realize that
EVERYTHING in ASP.Net is a class. You would use your classes the same way
you use System.String or any other class. Reference it, and use it. Using it
has nothing whatsoever to do with the global.asax class.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:86**********************************@microsof t.com...
Oh I have re-engineered using oop. I would still like to have an
application
level complex object that I store application level data,collections...
that
was the real question.

"Kevin Spencer" wrote:
> how do I create my applcation level objects and how do I access them
> in a
> webform using the new model?


This is probably going to sound crass, and I'm certainly used to being
called by that characterization, BUT...

1. Learn Object-oriented programming concepts
2. Learn the ASP.Net object model
3. Evaluate your requirements in the light of an OOP, ASP.Net application
4. Design your object model using the principles of OOP
5. Write your app

Here's why: ASP.Net and ASP have very little in common when it comes to
methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
extremely
limited. ASP.Net is unlimited. ASP has little or no programming model.
ASP.Net has a highly structured programming model.

In other words, just trying to "translate" ASP into ASP.Net is an
exercise
in futility. You might succeed, but you'll regret it for the lifetime of
your application. Rather than translate, I would strongly suggest
re-engineering.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:9E**********************************@microsof t.com...
>I am developing an asp.net app based on a previous asp application.
>
> in the asp applications global.asa file I had several
>
> <object id="id" runat="server" scope="scope" class="comclass"> tags for
> objects that the app used to speed up some global level data access and
> functionality.
>
> I have recoded the class libraries in .net and would like to acomplish
> the
> same functionality in asp.net.
>
> in examples I have seen you can still use the
> <object id="id" runat="server" scope="scope" class="Class Name">
> tags in global.asax but all these examples seem not to use the
> codebehind
> model where the global.asax file contains the class definition for
> global:
>
> Public Class Global
> Inherits System.Web.HttpApplication
> ...
>
> how do I create my applcation level objects and how do I access them
> in a
> webform using the new model?
>
> thx
>
>
> --
> randyr


Nov 19 '05 #4
I fully understand that but what I would like to do is create some of those
objects at application start and store them in application level variables
without having to store them as Application("xyz") , but rather the strongly
typed objects.

I tried adding public properties to the global class in global.asax based on
my class types, but did not find a way to access those members on a webform.

I fully understand how to use my class libraries. what I am asking for is an
equivalent way to create application level objects (ie as using the <object
tag in a global asa file) in light of the new asp.net object model.

thx
"Kevin Spencer" wrote:
If you've studied up on OOP and ASP.Net, then you should realize that
EVERYTHING in ASP.Net is a class. You would use your classes the same way
you use System.String or any other class. Reference it, and use it. Using it
has nothing whatsoever to do with the global.asax class.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:86**********************************@microsof t.com...
Oh I have re-engineered using oop. I would still like to have an
application
level complex object that I store application level data,collections...
that
was the real question.

"Kevin Spencer" wrote:
> how do I create my applcation level objects and how do I access them
> in a
> webform using the new model?

This is probably going to sound crass, and I'm certainly used to being
called by that characterization, BUT...

1. Learn Object-oriented programming concepts
2. Learn the ASP.Net object model
3. Evaluate your requirements in the light of an OOP, ASP.Net application
4. Design your object model using the principles of OOP
5. Write your app

Here's why: ASP.Net and ASP have very little in common when it comes to
methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
extremely
limited. ASP.Net is unlimited. ASP has little or no programming model.
ASP.Net has a highly structured programming model.

In other words, just trying to "translate" ASP into ASP.Net is an
exercise
in futility. You might succeed, but you'll regret it for the lifetime of
your application. Rather than translate, I would strongly suggest
re-engineering.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:9E**********************************@microsof t.com...
>I am developing an asp.net app based on a previous asp application.
>
> in the asp applications global.asa file I had several
>
> <object id="id" runat="server" scope="scope" class="comclass"> tags for
> objects that the app used to speed up some global level data access and
> functionality.
>
> I have recoded the class libraries in .net and would like to acomplish
> the
> same functionality in asp.net.
>
> in examples I have seen you can still use the
> <object id="id" runat="server" scope="scope" class="Class Name">
> tags in global.asax but all these examples seem not to use the
> codebehind
> model where the global.asax file contains the class definition for
> global:
>
> Public Class Global
> Inherits System.Web.HttpApplication
> ...
>
> how do I create my applcation level objects and how do I access them
> in a
> webform using the new model?
>
> thx
>
>
> --
> randyr


Nov 19 '05 #5
Try using a class with static methods and properties. Make the constructor
private and when the class is first instantiated, populate the data, this
would work much like the application_start event and would be strongly typed.

Mark

"randyr" wrote:
I fully understand that but what I would like to do is create some of those
objects at application start and store them in application level variables
without having to store them as Application("xyz") , but rather the strongly
typed objects.

I tried adding public properties to the global class in global.asax based on
my class types, but did not find a way to access those members on a webform.

I fully understand how to use my class libraries. what I am asking for is an
equivalent way to create application level objects (ie as using the <object
tag in a global asa file) in light of the new asp.net object model.

thx
"Kevin Spencer" wrote:
If you've studied up on OOP and ASP.Net, then you should realize that
EVERYTHING in ASP.Net is a class. You would use your classes the same way
you use System.String or any other class. Reference it, and use it. Using it
has nothing whatsoever to do with the global.asax class.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:86**********************************@microsof t.com...
Oh I have re-engineered using oop. I would still like to have an
application
level complex object that I store application level data,collections...
that
was the real question.

"Kevin Spencer" wrote:

> > how do I create my applcation level objects and how do I access them
> > in a
> > webform using the new model?
>
> This is probably going to sound crass, and I'm certainly used to being
> called by that characterization, BUT...
>
> 1. Learn Object-oriented programming concepts
> 2. Learn the ASP.Net object model
> 3. Evaluate your requirements in the light of an OOP, ASP.Net application
> 4. Design your object model using the principles of OOP
> 5. Write your app
>
> Here's why: ASP.Net and ASP have very little in common when it comes to
> methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
> extremely
> limited. ASP.Net is unlimited. ASP has little or no programming model.
> ASP.Net has a highly structured programming model.
>
> In other words, just trying to "translate" ASP into ASP.Net is an
> exercise
> in futility. You might succeed, but you'll regret it for the lifetime of
> your application. Rather than translate, I would strongly suggest
> re-engineering.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> What You Seek Is What You Get.
>
> "randyr" <ra****@online.nospam> wrote in message
> news:9E**********************************@microsof t.com...
> >I am developing an asp.net app based on a previous asp application.
> >
> > in the asp applications global.asa file I had several
> >
> > <object id="id" runat="server" scope="scope" class="comclass"> tags for
> > objects that the app used to speed up some global level data access and
> > functionality.
> >
> > I have recoded the class libraries in .net and would like to acomplish
> > the
> > same functionality in asp.net.
> >
> > in examples I have seen you can still use the
> > <object id="id" runat="server" scope="scope" class="Class Name">
> > tags in global.asax but all these examples seem not to use the
> > codebehind
> > model where the global.asax file contains the class definition for
> > global:
> >
> > Public Class Global
> > Inherits System.Web.HttpApplication
> > ...
> >
> > how do I create my applcation level objects and how do I access them
> > in a
> > webform using the new model?
> >
> > thx
> >
> >
> > --
> > randyr
>
>
>


Nov 19 '05 #6
I guess that is a possibility, where would you suggest creating and storing
this object for application level access??

I would still rather an equivalent to the old solution or at least a way of
extending the global object ... so that I can have a application level
object
any other ideas

"wsMarkM" wrote:
Try using a class with static methods and properties. Make the constructor
private and when the class is first instantiated, populate the data, this
would work much like the application_start event and would be strongly typed.

Mark

"randyr" wrote:
I fully understand that but what I would like to do is create some of those
objects at application start and store them in application level variables
without having to store them as Application("xyz") , but rather the strongly
typed objects.

I tried adding public properties to the global class in global.asax based on
my class types, but did not find a way to access those members on a webform.

I fully understand how to use my class libraries. what I am asking for is an
equivalent way to create application level objects (ie as using the <object
tag in a global asa file) in light of the new asp.net object model.

thx
"Kevin Spencer" wrote:
If you've studied up on OOP and ASP.Net, then you should realize that
EVERYTHING in ASP.Net is a class. You would use your classes the same way
you use System.String or any other class. Reference it, and use it. Using it
has nothing whatsoever to do with the global.asax class.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:86**********************************@microsof t.com...
> Oh I have re-engineered using oop. I would still like to have an
> application
> level complex object that I store application level data,collections...
> that
> was the real question.
>
> "Kevin Spencer" wrote:
>
>> > how do I create my applcation level objects and how do I access them
>> > in a
>> > webform using the new model?
>>
>> This is probably going to sound crass, and I'm certainly used to being
>> called by that characterization, BUT...
>>
>> 1. Learn Object-oriented programming concepts
>> 2. Learn the ASP.Net object model
>> 3. Evaluate your requirements in the light of an OOP, ASP.Net application
>> 4. Design your object model using the principles of OOP
>> 5. Write your app
>>
>> Here's why: ASP.Net and ASP have very little in common when it comes to
>> methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
>> extremely
>> limited. ASP.Net is unlimited. ASP has little or no programming model.
>> ASP.Net has a highly structured programming model.
>>
>> In other words, just trying to "translate" ASP into ASP.Net is an
>> exercise
>> in futility. You might succeed, but you'll regret it for the lifetime of
>> your application. Rather than translate, I would strongly suggest
>> re-engineering.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> What You Seek Is What You Get.
>>
>> "randyr" <ra****@online.nospam> wrote in message
>> news:9E**********************************@microsof t.com...
>> >I am developing an asp.net app based on a previous asp application.
>> >
>> > in the asp applications global.asa file I had several
>> >
>> > <object id="id" runat="server" scope="scope" class="comclass"> tags for
>> > objects that the app used to speed up some global level data access and
>> > functionality.
>> >
>> > I have recoded the class libraries in .net and would like to acomplish
>> > the
>> > same functionality in asp.net.
>> >
>> > in examples I have seen you can still use the
>> > <object id="id" runat="server" scope="scope" class="Class Name">
>> > tags in global.asax but all these examples seem not to use the
>> > codebehind
>> > model where the global.asax file contains the class definition for
>> > global:
>> >
>> > Public Class Global
>> > Inherits System.Web.HttpApplication
>> > ...
>> >
>> > how do I create my applcation level objects and how do I access them
>> > in a
>> > webform using the new model?
>> >
>> > thx
>> >
>> >
>> > --
>> > randyr
>>
>>
>>

Nov 19 '05 #7
public class myStaticClass{
private myStaticClass(){
//load data here
}

public static int myInt = 0;

}

"randyr" wrote:
I guess that is a possibility, where would you suggest creating and storing
this object for application level access??

I would still rather an equivalent to the old solution or at least a way of
extending the global object ... so that I can have a application level
object
any other ideas

"wsMarkM" wrote:
Try using a class with static methods and properties. Make the constructor
private and when the class is first instantiated, populate the data, this
would work much like the application_start event and would be strongly typed.

Mark

"randyr" wrote:
I fully understand that but what I would like to do is create some of those
objects at application start and store them in application level variables
without having to store them as Application("xyz") , but rather the strongly
typed objects.

I tried adding public properties to the global class in global.asax based on
my class types, but did not find a way to access those members on a webform.

I fully understand how to use my class libraries. what I am asking for is an
equivalent way to create application level objects (ie as using the <object
tag in a global asa file) in light of the new asp.net object model.

thx
"Kevin Spencer" wrote:

> If you've studied up on OOP and ASP.Net, then you should realize that
> EVERYTHING in ASP.Net is a class. You would use your classes the same way
> you use System.String or any other class. Reference it, and use it. Using it
> has nothing whatsoever to do with the global.asax class.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> What You Seek Is What You Get.
>
> "randyr" <ra****@online.nospam> wrote in message
> news:86**********************************@microsof t.com...
> > Oh I have re-engineered using oop. I would still like to have an
> > application
> > level complex object that I store application level data,collections...
> > that
> > was the real question.
> >
> > "Kevin Spencer" wrote:
> >
> >> > how do I create my applcation level objects and how do I access them
> >> > in a
> >> > webform using the new model?
> >>
> >> This is probably going to sound crass, and I'm certainly used to being
> >> called by that characterization, BUT...
> >>
> >> 1. Learn Object-oriented programming concepts
> >> 2. Learn the ASP.Net object model
> >> 3. Evaluate your requirements in the light of an OOP, ASP.Net application
> >> 4. Design your object model using the principles of OOP
> >> 5. Write your app
> >>
> >> Here's why: ASP.Net and ASP have very little in common when it comes to
> >> methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
> >> extremely
> >> limited. ASP.Net is unlimited. ASP has little or no programming model.
> >> ASP.Net has a highly structured programming model.
> >>
> >> In other words, just trying to "translate" ASP into ASP.Net is an
> >> exercise
> >> in futility. You might succeed, but you'll regret it for the lifetime of
> >> your application. Rather than translate, I would strongly suggest
> >> re-engineering.
> >>
> >> --
> >> HTH,
> >>
> >> Kevin Spencer
> >> Microsoft MVP
> >> ..Net Developer
> >> What You Seek Is What You Get.
> >>
> >> "randyr" <ra****@online.nospam> wrote in message
> >> news:9E**********************************@microsof t.com...
> >> >I am developing an asp.net app based on a previous asp application.
> >> >
> >> > in the asp applications global.asa file I had several
> >> >
> >> > <object id="id" runat="server" scope="scope" class="comclass"> tags for
> >> > objects that the app used to speed up some global level data access and
> >> > functionality.
> >> >
> >> > I have recoded the class libraries in .net and would like to acomplish
> >> > the
> >> > same functionality in asp.net.
> >> >
> >> > in examples I have seen you can still use the
> >> > <object id="id" runat="server" scope="scope" class="Class Name">
> >> > tags in global.asax but all these examples seem not to use the
> >> > codebehind
> >> > model where the global.asax file contains the class definition for
> >> > global:
> >> >
> >> > Public Class Global
> >> > Inherits System.Web.HttpApplication
> >> > ...
> >> >
> >> > how do I create my applcation level objects and how do I access them
> >> > in a
> >> > webform using the new model?
> >> >
> >> > thx
> >> >
> >> >
> >> > --
> >> > randyr
> >>
> >>
> >>
>
>
>

Nov 19 '05 #8
Sorry the last reponse prematurly posted but the code should give you an
idea. Then you can access the class from anywhere as long as your project /
page has a reference to the namespace/assembly. You can simply call it like
this:

In page_A.aspx
myStaticClass.myInt = 1234;

In page_B.aspx
if(myStaticClass.myInt > 10)
//do something;

The thing about static members is you don't have to "store" a reference to
them anywhere. You just reference them w/o an instance variable and use them.
They are accessable anywhere (as long as they are public) and they live as
long as the application is running.

I'm sure you could add public members to the HttpApplication class, but I
can't look at that right now. I can check it out for you tomorrow though
(hittin' the road).

Mark
"randyr" wrote:
I guess that is a possibility, where would you suggest creating and storing
this object for application level access??

I would still rather an equivalent to the old solution or at least a way of
extending the global object ... so that I can have a application level
object
any other ideas

"wsMarkM" wrote:
Try using a class with static methods and properties. Make the constructor
private and when the class is first instantiated, populate the data, this
would work much like the application_start event and would be strongly typed.

Mark

"randyr" wrote:
I fully understand that but what I would like to do is create some of those
objects at application start and store them in application level variables
without having to store them as Application("xyz") , but rather the strongly
typed objects.

I tried adding public properties to the global class in global.asax based on
my class types, but did not find a way to access those members on a webform.

I fully understand how to use my class libraries. what I am asking for is an
equivalent way to create application level objects (ie as using the <object
tag in a global asa file) in light of the new asp.net object model.

thx
"Kevin Spencer" wrote:

> If you've studied up on OOP and ASP.Net, then you should realize that
> EVERYTHING in ASP.Net is a class. You would use your classes the same way
> you use System.String or any other class. Reference it, and use it. Using it
> has nothing whatsoever to do with the global.asax class.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> What You Seek Is What You Get.
>
> "randyr" <ra****@online.nospam> wrote in message
> news:86**********************************@microsof t.com...
> > Oh I have re-engineered using oop. I would still like to have an
> > application
> > level complex object that I store application level data,collections...
> > that
> > was the real question.
> >
> > "Kevin Spencer" wrote:
> >
> >> > how do I create my applcation level objects and how do I access them
> >> > in a
> >> > webform using the new model?
> >>
> >> This is probably going to sound crass, and I'm certainly used to being
> >> called by that characterization, BUT...
> >>
> >> 1. Learn Object-oriented programming concepts
> >> 2. Learn the ASP.Net object model
> >> 3. Evaluate your requirements in the light of an OOP, ASP.Net application
> >> 4. Design your object model using the principles of OOP
> >> 5. Write your app
> >>
> >> Here's why: ASP.Net and ASP have very little in common when it comes to
> >> methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
> >> extremely
> >> limited. ASP.Net is unlimited. ASP has little or no programming model.
> >> ASP.Net has a highly structured programming model.
> >>
> >> In other words, just trying to "translate" ASP into ASP.Net is an
> >> exercise
> >> in futility. You might succeed, but you'll regret it for the lifetime of
> >> your application. Rather than translate, I would strongly suggest
> >> re-engineering.
> >>
> >> --
> >> HTH,
> >>
> >> Kevin Spencer
> >> Microsoft MVP
> >> ..Net Developer
> >> What You Seek Is What You Get.
> >>
> >> "randyr" <ra****@online.nospam> wrote in message
> >> news:9E**********************************@microsof t.com...
> >> >I am developing an asp.net app based on a previous asp application.
> >> >
> >> > in the asp applications global.asa file I had several
> >> >
> >> > <object id="id" runat="server" scope="scope" class="comclass"> tags for
> >> > objects that the app used to speed up some global level data access and
> >> > functionality.
> >> >
> >> > I have recoded the class libraries in .net and would like to acomplish
> >> > the
> >> > same functionality in asp.net.
> >> >
> >> > in examples I have seen you can still use the
> >> > <object id="id" runat="server" scope="scope" class="Class Name">
> >> > tags in global.asax but all these examples seem not to use the
> >> > codebehind
> >> > model where the global.asax file contains the class definition for
> >> > global:
> >> >
> >> > Public Class Global
> >> > Inherits System.Web.HttpApplication
> >> > ...
> >> >
> >> > how do I create my applcation level objects and how do I access them
> >> > in a
> >> > webform using the new model?
> >> >
> >> > thx
> >> >
> >> >
> >> > --
> >> > randyr
> >>
> >>
> >>
>
>
>

Nov 19 '05 #9
Hi Randyr,

I think we may have further works need to do if we want to get the those
components objects works in ASP.NET just like those global <object >
serverside tags in CLASSIC ASP:

1. As other members have mentioned, we no longer need to use serverside
<object > tag in asp.net , we can just define static class member variables
in the ASP.NET application's Global class to hold the reference of our
global component objects.

2. The second and is the most important point, is that your components are
COM objects( rather than .net class objects). So we can't reference COM
objects directly in .NET world. We need to define .net wrapper class for
those COM objects. And if you're using VS.NET , you can use the "Add
Reference" menu to add the COM objects into your project and VS.NET will
automatically create the Wrapper classes of those COM class for you. Then,
we can reference those wrapper classes in your .net code. Something like
below:

=========================
public class Global : System.Web.HttpApplication
{
public static COMWrapperClass comobj = null;

................

protected void Application_Start(Object sender, EventArgs e)
{
comobj = new COMWrapperClass();
}
.............

========================

And we can reference that static variable in our page's code. Note, in
ASP.NET all the page is executing under FreeThread retrieved from
threadpool (not the STA mode thread as in classic ASP). If your COM
components are STA component, be sure to set your asp.net page as
"aspCompat" = true in the @page directive.

In addition, here are some reference in MSDN on accessing COM objects in
NET through interop or migrate classic ASP code to ASP.NET

#Converting ASP to ASP.NET
http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/convertasptoaspnet.asp

#Calling COM Components from .NET Clients
http://msdn.microsoft.com/library/en...omp.asp?frame=
true

For further questions about .NET's interop with COM, I suggest you try
posting in the dotnet.framework.interop newsgroup, you can find more
resources on COM interop there.

HTH. Thanks,
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #10
I'm afraid you don't fully understand. Putting a class in a Collection
doesn't make it any less strongly-typed. The Application Collection (which
is pretty well deprecated now in favor of the Cache), the Application Cache,
and the other caching mechanisms of ASP.Net do not change or "reduce" the
type of a class.

If you want to store something in Application, you simply create an instance
and store it. Forget about <OBJECT> tags and other procedural workarounds.
Think abstract!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:AE**********************************@microsof t.com...
I fully understand that but what I would like to do is create some of those
objects at application start and store them in application level variables
without having to store them as Application("xyz") , but rather the
strongly
typed objects.

I tried adding public properties to the global class in global.asax based
on
my class types, but did not find a way to access those members on a
webform.

I fully understand how to use my class libraries. what I am asking for is
an
equivalent way to create application level objects (ie as using the
<object
tag in a global asa file) in light of the new asp.net object model.

thx
"Kevin Spencer" wrote:
If you've studied up on OOP and ASP.Net, then you should realize that
EVERYTHING in ASP.Net is a class. You would use your classes the same way
you use System.String or any other class. Reference it, and use it. Using
it
has nothing whatsoever to do with the global.asax class.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:86**********************************@microsof t.com...
> Oh I have re-engineered using oop. I would still like to have an
> application
> level complex object that I store application level data,collections...
> that
> was the real question.
>
> "Kevin Spencer" wrote:
>
>> > how do I create my applcation level objects and how do I access them
>> > in a
>> > webform using the new model?
>>
>> This is probably going to sound crass, and I'm certainly used to being
>> called by that characterization, BUT...
>>
>> 1. Learn Object-oriented programming concepts
>> 2. Learn the ASP.Net object model
>> 3. Evaluate your requirements in the light of an OOP, ASP.Net
>> application
>> 4. Design your object model using the principles of OOP
>> 5. Write your app
>>
>> Here's why: ASP.Net and ASP have very little in common when it comes
>> to
>> methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
>> extremely
>> limited. ASP.Net is unlimited. ASP has little or no programming model.
>> ASP.Net has a highly structured programming model.
>>
>> In other words, just trying to "translate" ASP into ASP.Net is an
>> exercise
>> in futility. You might succeed, but you'll regret it for the lifetime
>> of
>> your application. Rather than translate, I would strongly suggest
>> re-engineering.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> What You Seek Is What You Get.
>>
>> "randyr" <ra****@online.nospam> wrote in message
>> news:9E**********************************@microsof t.com...
>> >I am developing an asp.net app based on a previous asp application.
>> >
>> > in the asp applications global.asa file I had several
>> >
>> > <object id="id" runat="server" scope="scope" class="comclass"> tags
>> > for
>> > objects that the app used to speed up some global level data access
>> > and
>> > functionality.
>> >
>> > I have recoded the class libraries in .net and would like to
>> > acomplish
>> > the
>> > same functionality in asp.net.
>> >
>> > in examples I have seen you can still use the
>> > <object id="id" runat="server" scope="scope" class="Class Name">
>> > tags in global.asax but all these examples seem not to use the
>> > codebehind
>> > model where the global.asax file contains the class definition for
>> > global:
>> >
>> > Public Class Global
>> > Inherits System.Web.HttpApplication
>> > ...
>> >
>> > how do I create my applcation level objects and how do I access them
>> > in a
>> > webform using the new model?
>> >
>> > thx
>> >
>> >
>> > --
>> > randyr
>>
>>
>>


Nov 19 '05 #11
> 1. As other members have mentioned, we no longer need to use serverside
<object > tag in asp.net , we can just define static class member
variables
in the ASP.NET application's Global class to hold the reference of our
global component objects.
I'm afraid I have to take issue with this statement. It implies that THE
method for cahing objects is to make them static. In fact, there is a place
for static objects, and there is a place for instance objects. And I would
venture to guess that instance objects are more often useful than static
objects, for a variety of reasons. For one thing, static objects are not
thread-safe. And a static Collection is begging for trouble.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:a8*************@TK2MSFTNGXA02.phx.gbl... Hi Randyr,

I think we may have further works need to do if we want to get the those
components objects works in ASP.NET just like those global <object >
serverside tags in CLASSIC ASP:

1. As other members have mentioned, we no longer need to use serverside
<object > tag in asp.net , we can just define static class member
variables
in the ASP.NET application's Global class to hold the reference of our
global component objects.

2. The second and is the most important point, is that your components are
COM objects( rather than .net class objects). So we can't reference COM
objects directly in .NET world. We need to define .net wrapper class for
those COM objects. And if you're using VS.NET , you can use the "Add
Reference" menu to add the COM objects into your project and VS.NET will
automatically create the Wrapper classes of those COM class for you. Then,
we can reference those wrapper classes in your .net code. Something like
below:

=========================
public class Global : System.Web.HttpApplication
{
public static COMWrapperClass comobj = null;

................

protected void Application_Start(Object sender, EventArgs e)
{
comobj = new COMWrapperClass();
}
............

========================

And we can reference that static variable in our page's code. Note, in
ASP.NET all the page is executing under FreeThread retrieved from
threadpool (not the STA mode thread as in classic ASP). If your COM
components are STA component, be sure to set your asp.net page as
"aspCompat" = true in the @page directive.

In addition, here are some reference in MSDN on accessing COM objects in
NET through interop or migrate classic ASP code to ASP.NET

#Converting ASP to ASP.NET
http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/convertasptoaspnet.asp

#Calling COM Components from .NET Clients
http://msdn.microsoft.com/library/en...omp.asp?frame=
true

For further questions about .NET's interop with COM, I suggest you try
posting in the dotnet.framework.interop newsgroup, you can find more
resources on COM interop there.

HTH. Thanks,
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #12
Ok,
I'll accept that it is not such a loss storing the objects in the
application cache, but just for my own reference if you want to extend the
global class and add a few public members and access those in web forms how
would you do that?

"Kevin Spencer" wrote:
I'm afraid you don't fully understand. Putting a class in a Collection
doesn't make it any less strongly-typed. The Application Collection (which
is pretty well deprecated now in favor of the Cache), the Application Cache,
and the other caching mechanisms of ASP.Net do not change or "reduce" the
type of a class.

If you want to store something in Application, you simply create an instance
and store it. Forget about <OBJECT> tags and other procedural workarounds.
Think abstract!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:AE**********************************@microsof t.com...
I fully understand that but what I would like to do is create some of those
objects at application start and store them in application level variables
without having to store them as Application("xyz") , but rather the
strongly
typed objects.

I tried adding public properties to the global class in global.asax based
on
my class types, but did not find a way to access those members on a
webform.

I fully understand how to use my class libraries. what I am asking for is
an
equivalent way to create application level objects (ie as using the
<object
tag in a global asa file) in light of the new asp.net object model.

thx
"Kevin Spencer" wrote:
If you've studied up on OOP and ASP.Net, then you should realize that
EVERYTHING in ASP.Net is a class. You would use your classes the same way
you use System.String or any other class. Reference it, and use it. Using
it
has nothing whatsoever to do with the global.asax class.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:86**********************************@microsof t.com...
> Oh I have re-engineered using oop. I would still like to have an
> application
> level complex object that I store application level data,collections...
> that
> was the real question.
>
> "Kevin Spencer" wrote:
>
>> > how do I create my applcation level objects and how do I access them
>> > in a
>> > webform using the new model?
>>
>> This is probably going to sound crass, and I'm certainly used to being
>> called by that characterization, BUT...
>>
>> 1. Learn Object-oriented programming concepts
>> 2. Learn the ASP.Net object model
>> 3. Evaluate your requirements in the light of an OOP, ASP.Net
>> application
>> 4. Design your object model using the principles of OOP
>> 5. Write your app
>>
>> Here's why: ASP.Net and ASP have very little in common when it comes
>> to
>> methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
>> extremely
>> limited. ASP.Net is unlimited. ASP has little or no programming model.
>> ASP.Net has a highly structured programming model.
>>
>> In other words, just trying to "translate" ASP into ASP.Net is an
>> exercise
>> in futility. You might succeed, but you'll regret it for the lifetime
>> of
>> your application. Rather than translate, I would strongly suggest
>> re-engineering.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> What You Seek Is What You Get.
>>
>> "randyr" <ra****@online.nospam> wrote in message
>> news:9E**********************************@microsof t.com...
>> >I am developing an asp.net app based on a previous asp application.
>> >
>> > in the asp applications global.asa file I had several
>> >
>> > <object id="id" runat="server" scope="scope" class="comclass"> tags
>> > for
>> > objects that the app used to speed up some global level data access
>> > and
>> > functionality.
>> >
>> > I have recoded the class libraries in .net and would like to
>> > acomplish
>> > the
>> > same functionality in asp.net.
>> >
>> > in examples I have seen you can still use the
>> > <object id="id" runat="server" scope="scope" class="Class Name">
>> > tags in global.asax but all these examples seem not to use the
>> > codebehind
>> > model where the global.asax file contains the class definition for
>> > global:
>> >
>> > Public Class Global
>> > Inherits System.Web.HttpApplication
>> > ...
>> >
>> > how do I create my applcation level objects and how do I access them
>> > in a
>> > webform using the new model?
>> >
>> > thx
>> >
>> >
>> > --
>> > randyr
>>
>>
>>


Nov 19 '05 #13
> I'll accept that it is not such a loss storing the objects in the
application cache, but just for my own reference if you want to extend the
global class and add a few public members and access those in web forms
how
would you do that?
I would not do that. The Global class has a specific usage, and I don't mess
with it. However, you might define another class and use the
Application_OnStart to create an instance of that class and store it in
cache.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:21**********************************@microsof t.com... Ok,
I'll accept that it is not such a loss storing the objects in the
application cache, but just for my own reference if you want to extend the
global class and add a few public members and access those in web forms
how
would you do that?

"Kevin Spencer" wrote:
I'm afraid you don't fully understand. Putting a class in a Collection
doesn't make it any less strongly-typed. The Application Collection
(which
is pretty well deprecated now in favor of the Cache), the Application
Cache,
and the other caching mechanisms of ASP.Net do not change or "reduce" the
type of a class.

If you want to store something in Application, you simply create an
instance
and store it. Forget about <OBJECT> tags and other procedural
workarounds.
Think abstract!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:AE**********************************@microsof t.com...
>I fully understand that but what I would like to do is create some of
>those
> objects at application start and store them in application level
> variables
> without having to store them as Application("xyz") , but rather the
> strongly
> typed objects.
>
> I tried adding public properties to the global class in global.asax
> based
> on
> my class types, but did not find a way to access those members on a
> webform.
>
> I fully understand how to use my class libraries. what I am asking for
> is
> an
> equivalent way to create application level objects (ie as using the
> <object
> tag in a global asa file) in light of the new asp.net object model.
>
> thx
>
>
> "Kevin Spencer" wrote:
>
>> If you've studied up on OOP and ASP.Net, then you should realize that
>> EVERYTHING in ASP.Net is a class. You would use your classes the same
>> way
>> you use System.String or any other class. Reference it, and use it.
>> Using
>> it
>> has nothing whatsoever to do with the global.asax class.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> What You Seek Is What You Get.
>>
>> "randyr" <ra****@online.nospam> wrote in message
>> news:86**********************************@microsof t.com...
>> > Oh I have re-engineered using oop. I would still like to have an
>> > application
>> > level complex object that I store application level
>> > data,collections...
>> > that
>> > was the real question.
>> >
>> > "Kevin Spencer" wrote:
>> >
>> >> > how do I create my applcation level objects and how do I access
>> >> > them
>> >> > in a
>> >> > webform using the new model?
>> >>
>> >> This is probably going to sound crass, and I'm certainly used to
>> >> being
>> >> called by that characterization, BUT...
>> >>
>> >> 1. Learn Object-oriented programming concepts
>> >> 2. Learn the ASP.Net object model
>> >> 3. Evaluate your requirements in the light of an OOP, ASP.Net
>> >> application
>> >> 4. Design your object model using the principles of OOP
>> >> 5. Write your app
>> >>
>> >> Here's why: ASP.Net and ASP have very little in common when it
>> >> comes
>> >> to
>> >> methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
>> >> extremely
>> >> limited. ASP.Net is unlimited. ASP has little or no programming
>> >> model.
>> >> ASP.Net has a highly structured programming model.
>> >>
>> >> In other words, just trying to "translate" ASP into ASP.Net is an
>> >> exercise
>> >> in futility. You might succeed, but you'll regret it for the
>> >> lifetime
>> >> of
>> >> your application. Rather than translate, I would strongly suggest
>> >> re-engineering.
>> >>
>> >> --
>> >> HTH,
>> >>
>> >> Kevin Spencer
>> >> Microsoft MVP
>> >> ..Net Developer
>> >> What You Seek Is What You Get.
>> >>
>> >> "randyr" <ra****@online.nospam> wrote in message
>> >> news:9E**********************************@microsof t.com...
>> >> >I am developing an asp.net app based on a previous asp
>> >> >application.
>> >> >
>> >> > in the asp applications global.asa file I had several
>> >> >
>> >> > <object id="id" runat="server" scope="scope" class="comclass">
>> >> > tags
>> >> > for
>> >> > objects that the app used to speed up some global level data
>> >> > access
>> >> > and
>> >> > functionality.
>> >> >
>> >> > I have recoded the class libraries in .net and would like to
>> >> > acomplish
>> >> > the
>> >> > same functionality in asp.net.
>> >> >
>> >> > in examples I have seen you can still use the
>> >> > <object id="id" runat="server" scope="scope" class="Class Name">
>> >> > tags in global.asax but all these examples seem not to use the
>> >> > codebehind
>> >> > model where the global.asax file contains the class definition
>> >> > for
>> >> > global:
>> >> >
>> >> > Public Class Global
>> >> > Inherits System.Web.HttpApplication
>> >> > ...
>> >> >
>> >> > how do I create my applcation level objects and how do I access
>> >> > them
>> >> > in a
>> >> > webform using the new model?
>> >> >
>> >> > thx
>> >> >
>> >> >
>> >> > --
>> >> > randyr
>> >>
>> >>
>> >>
>>
>>
>>


Nov 19 '05 #14
Assuming the name of the class which inherits from the HttpApplication class
is "Global" (VS.Net defualt) then you can use the following line of code to
access your custom instance members.

((Global) Context.ApplicationInstance).myInstanceProperty;

I didn't try and do a proper test to see if you need to use a lock on this.
I know that it pulls the instance from a pool of HttpApplication objects and
each instance services one request at a time and then returns to the pool.
But if you want to modify the value, I don't know how it updates the other
instances in the pool or how it should be synced up with the other instances
(if it must be done manually).

But you mentioned that you were concerned about using static members because
of thread safty. Getting around that issue is simple. Instead of using static
fields, use a static property or method where the field is private. When the
set method is called or the public method is called you can lock the field
like this:

private static _myInt;
public static int myInt{
set{
lock(_myInt){
_myInt = value;
}
}
}
I hope that helps

"randyr" wrote:
Ok,
I'll accept that it is not such a loss storing the objects in the
application cache, but just for my own reference if you want to extend the
global class and add a few public members and access those in web forms how
would you do that?

"Kevin Spencer" wrote:
I'm afraid you don't fully understand. Putting a class in a Collection
doesn't make it any less strongly-typed. The Application Collection (which
is pretty well deprecated now in favor of the Cache), the Application Cache,
and the other caching mechanisms of ASP.Net do not change or "reduce" the
type of a class.

If you want to store something in Application, you simply create an instance
and store it. Forget about <OBJECT> tags and other procedural workarounds.
Think abstract!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:AE**********************************@microsof t.com...
I fully understand that but what I would like to do is create some of those
objects at application start and store them in application level variables
without having to store them as Application("xyz") , but rather the
strongly
typed objects.

I tried adding public properties to the global class in global.asax based
on
my class types, but did not find a way to access those members on a
webform.

I fully understand how to use my class libraries. what I am asking for is
an
equivalent way to create application level objects (ie as using the
<object
tag in a global asa file) in light of the new asp.net object model.

thx
"Kevin Spencer" wrote:

> If you've studied up on OOP and ASP.Net, then you should realize that
> EVERYTHING in ASP.Net is a class. You would use your classes the same way
> you use System.String or any other class. Reference it, and use it. Using
> it
> has nothing whatsoever to do with the global.asax class.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> What You Seek Is What You Get.
>
> "randyr" <ra****@online.nospam> wrote in message
> news:86**********************************@microsof t.com...
> > Oh I have re-engineered using oop. I would still like to have an
> > application
> > level complex object that I store application level data,collections...
> > that
> > was the real question.
> >
> > "Kevin Spencer" wrote:
> >
> >> > how do I create my applcation level objects and how do I access them
> >> > in a
> >> > webform using the new model?
> >>
> >> This is probably going to sound crass, and I'm certainly used to being
> >> called by that characterization, BUT...
> >>
> >> 1. Learn Object-oriented programming concepts
> >> 2. Learn the ASP.Net object model
> >> 3. Evaluate your requirements in the light of an OOP, ASP.Net
> >> application
> >> 4. Design your object model using the principles of OOP
> >> 5. Write your app
> >>
> >> Here's why: ASP.Net and ASP have very little in common when it comes
> >> to
> >> methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
> >> extremely
> >> limited. ASP.Net is unlimited. ASP has little or no programming model.
> >> ASP.Net has a highly structured programming model.
> >>
> >> In other words, just trying to "translate" ASP into ASP.Net is an
> >> exercise
> >> in futility. You might succeed, but you'll regret it for the lifetime
> >> of
> >> your application. Rather than translate, I would strongly suggest
> >> re-engineering.
> >>
> >> --
> >> HTH,
> >>
> >> Kevin Spencer
> >> Microsoft MVP
> >> ..Net Developer
> >> What You Seek Is What You Get.
> >>
> >> "randyr" <ra****@online.nospam> wrote in message
> >> news:9E**********************************@microsof t.com...
> >> >I am developing an asp.net app based on a previous asp application.
> >> >
> >> > in the asp applications global.asa file I had several
> >> >
> >> > <object id="id" runat="server" scope="scope" class="comclass"> tags
> >> > for
> >> > objects that the app used to speed up some global level data access
> >> > and
> >> > functionality.
> >> >
> >> > I have recoded the class libraries in .net and would like to
> >> > acomplish
> >> > the
> >> > same functionality in asp.net.
> >> >
> >> > in examples I have seen you can still use the
> >> > <object id="id" runat="server" scope="scope" class="Class Name">
> >> > tags in global.asax but all these examples seem not to use the
> >> > codebehind
> >> > model where the global.asax file contains the class definition for
> >> > global:
> >> >
> >> > Public Class Global
> >> > Inherits System.Web.HttpApplication
> >> > ...
> >> >
> >> > how do I create my applcation level objects and how do I access them
> >> > in a
> >> > webform using the new model?
> >> >
> >> > thx
> >> >
> >> >
> >> > --
> >> > randyr
> >>
> >>
> >>
>
>
>


Nov 19 '05 #15
thanks

"Kevin Spencer" wrote:
I'll accept that it is not such a loss storing the objects in the
application cache, but just for my own reference if you want to extend the
global class and add a few public members and access those in web forms
how
would you do that?


I would not do that. The Global class has a specific usage, and I don't mess
with it. However, you might define another class and use the
Application_OnStart to create an instance of that class and store it in
cache.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:21**********************************@microsof t.com...
Ok,
I'll accept that it is not such a loss storing the objects in the
application cache, but just for my own reference if you want to extend the
global class and add a few public members and access those in web forms
how
would you do that?

"Kevin Spencer" wrote:
I'm afraid you don't fully understand. Putting a class in a Collection
doesn't make it any less strongly-typed. The Application Collection
(which
is pretty well deprecated now in favor of the Cache), the Application
Cache,
and the other caching mechanisms of ASP.Net do not change or "reduce" the
type of a class.

If you want to store something in Application, you simply create an
instance
and store it. Forget about <OBJECT> tags and other procedural
workarounds.
Think abstract!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"randyr" <ra****@online.nospam> wrote in message
news:AE**********************************@microsof t.com...
>I fully understand that but what I would like to do is create some of
>those
> objects at application start and store them in application level
> variables
> without having to store them as Application("xyz") , but rather the
> strongly
> typed objects.
>
> I tried adding public properties to the global class in global.asax
> based
> on
> my class types, but did not find a way to access those members on a
> webform.
>
> I fully understand how to use my class libraries. what I am asking for
> is
> an
> equivalent way to create application level objects (ie as using the
> <object
> tag in a global asa file) in light of the new asp.net object model.
>
> thx
>
>
> "Kevin Spencer" wrote:
>
>> If you've studied up on OOP and ASP.Net, then you should realize that
>> EVERYTHING in ASP.Net is a class. You would use your classes the same
>> way
>> you use System.String or any other class. Reference it, and use it.
>> Using
>> it
>> has nothing whatsoever to do with the global.asax class.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> What You Seek Is What You Get.
>>
>> "randyr" <ra****@online.nospam> wrote in message
>> news:86**********************************@microsof t.com...
>> > Oh I have re-engineered using oop. I would still like to have an
>> > application
>> > level complex object that I store application level
>> > data,collections...
>> > that
>> > was the real question.
>> >
>> > "Kevin Spencer" wrote:
>> >
>> >> > how do I create my applcation level objects and how do I access
>> >> > them
>> >> > in a
>> >> > webform using the new model?
>> >>
>> >> This is probably going to sound crass, and I'm certainly used to
>> >> being
>> >> called by that characterization, BUT...
>> >>
>> >> 1. Learn Object-oriented programming concepts
>> >> 2. Learn the ASP.Net object model
>> >> 3. Evaluate your requirements in the light of an OOP, ASP.Net
>> >> application
>> >> 4. Design your object model using the principles of OOP
>> >> 5. Write your app
>> >>
>> >> Here's why: ASP.Net and ASP have very little in common when it
>> >> comes
>> >> to
>> >> methodology. ASP is procedural. ASP.Net is object-oriented. ASP is
>> >> extremely
>> >> limited. ASP.Net is unlimited. ASP has little or no programming
>> >> model.
>> >> ASP.Net has a highly structured programming model.
>> >>
>> >> In other words, just trying to "translate" ASP into ASP.Net is an
>> >> exercise
>> >> in futility. You might succeed, but you'll regret it for the
>> >> lifetime
>> >> of
>> >> your application. Rather than translate, I would strongly suggest
>> >> re-engineering.
>> >>
>> >> --
>> >> HTH,
>> >>
>> >> Kevin Spencer
>> >> Microsoft MVP
>> >> ..Net Developer
>> >> What You Seek Is What You Get.
>> >>
>> >> "randyr" <ra****@online.nospam> wrote in message
>> >> news:9E**********************************@microsof t.com...
>> >> >I am developing an asp.net app based on a previous asp
>> >> >application.
>> >> >
>> >> > in the asp applications global.asa file I had several
>> >> >
>> >> > <object id="id" runat="server" scope="scope" class="comclass">
>> >> > tags
>> >> > for
>> >> > objects that the app used to speed up some global level data
>> >> > access
>> >> > and
>> >> > functionality.
>> >> >
>> >> > I have recoded the class libraries in .net and would like to
>> >> > acomplish
>> >> > the
>> >> > same functionality in asp.net.
>> >> >
>> >> > in examples I have seen you can still use the
>> >> > <object id="id" runat="server" scope="scope" class="Class Name">
>> >> > tags in global.asax but all these examples seem not to use the
>> >> > codebehind
>> >> > model where the global.asax file contains the class definition
>> >> > for
>> >> > global:
>> >> >
>> >> > Public Class Global
>> >> > Inherits System.Web.HttpApplication
>> >> > ...
>> >> >
>> >> > how do I create my applcation level objects and how do I access
>> >> > them
>> >> > in a
>> >> > webform using the new model?
>> >> >
>> >> > thx
>> >> >
>> >> >
>> >> > --
>> >> > randyr
>> >>
>> >>
>> >>
>>
>>
>>


Nov 19 '05 #16

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

Similar topics

1
by: Clas | last post by:
Hi! I have a multi-layer business application written in VB.NET. The client can be either a website or a webform communicting with the bussines-layers through webservices. In "Client-classes" i'm...
0
by: Jim Hammond | last post by:
I have a client-side component that captures an image and saves it in a file on the client system's hard drive. Although I can return text data from the component and transparently get that text...
3
by: Juan Carlos | last post by:
Hi, I developer an ASP.NET web application that use an COM object. In global.asax put <object id="myCom" runat="server" classid="COMClass" scope="session"/> It's ok, no?? (little question,...
8
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical...
3
by: CsaaGuy | last post by:
I have a general question. There is a javascript object called xmlhttp that can be used to callback into you webpage and run server side code without a postback (submit). I have got this to work...
2
by: damian.jolly | last post by:
Is persisting objects to the SESSION the best way to prevent an object from being created every time a page is refreshed? It's a bit complicated but I'll try to be brief... I am using a guage...
11
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.