global.asax中的服务器端对象标记 [英] server side object tags in global.asax

查看:59
本文介绍了global.asax中的服务器端对象标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个基于以前的asp应用程序的asp.net应用程序。


在asp应用程序global.asa文件中我有几个


< object id =" id" RUNAT = QUOT;服务器"范围= QUOT;范围"类= QUOT; comclass">标签为

该应用程序用于加速某些全局级别数据访问和

功能的对象。


我已重新编码.net中的类库,并希望在asp.net中实现

相同的功能。


在示例中我看到你仍然可以使用

< object id =" id" RUNAT = QUOT;服务器"范围= QUOT;范围" class ="类名">

global.asax中的标签,但所有这些示例似乎都不使用代码隐藏

模型,其中global.asax文件包含类全球定义:


Public Class Global

继承System.Web.HttpApplication

....


如何创建applcation级别对象以及如何使用新模型在

webform中访问它们?


thx

-

randyr

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

推荐答案

>如何创建我的applcation级别对象以及如何使用新模型在
> how do I create my applcation level objects and how do I access them in a
webform中访问它们?


这可能听起来很糟糕,而且我当然习惯于通过这种描述来调用它们,但是... ...


1.学习面向对象的编程概念

2.学习ASP.Net对象模型

3.根据需求评估您的要求OOP,ASP.Net应用程序

4.使用OOP原理设计对象模型

5.编写应用程序


这就是为什么:ASP.Net和ASP在

方法论方面几乎没有共同之处。 ASP是程序性的。 ASP.Net是面向对象的。 ASP非常有限。 ASP.Net是无限的。 ASP几乎没有编程模型。

ASP.Net有一个高度结构化的编程模型。


换句话说,只是试图翻译。 ASP进入ASP.Net是徒劳的一项练习

。你可能会成功,但是你会在你的应用程序的生命周期中后悔。而不是翻译,我强烈建议

重新设计。


-

HTH,


Kevin Spencer

Microsoft MVP

..Net开发人员

你所寻求的是你得到的。


" randyr" < RA **** @ online.nospam>在留言中写道

news:9E ********************************** @ microsof t.com ...我正在开发一个基于以前的asp应用程序的asp.net应用程序。

在asp应用程序global.asa文件中我有几个

< object id =" id" RUNAT = QUOT;服务器"范围= QUOT;范围"类= QUOT; comclass">应用程序用来加速某些全局级别数据访问和功能的对象的标签。

我已经在.net中重新编写了类库并希望完成<在asp.net中具有相同的功能。

在我看到的例子中你仍然可以使用
< object id =" id" RUNAT = QUOT;服务器"范围= QUOT;范围" global.asax中的class =" Class Name">
标签,但所有这些示例似乎都没有使用global.asax文件包含全局类定义的代码隐藏模型:

Public Class Global
继承System.Web.HttpApplication
...

如何创建applcation级别对象以及如何在 webform使用新模型?


-
randyr
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



哦,我已经使用oop重新设计了。我仍然希望有一个应用程序

级复杂对象,我存储应用程序级数据,集合...

是真正的问题。


" Kevin Spencer"写道:
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:
如何创建我的applcation级别对象以及如何使用新模型在
webform中访问它们?
how do I create my applcation level objects and how do I access them in a
webform using the new model?



这可能听起来很糟糕,而且我当然习惯被这种描述所称,但是......

1。学习面向对象的编程概念
2.学习ASP.Net对象模型
3.根据OOP,ASP.Net应用程序评估您的需求
4.使用设计对象模型OOP的原则
5.编写你的应用程序

这就是为什么:ASP.Net和ASP在
方法论上几乎没有共同之处。 ASP是程序性的。 ASP.Net是面向对象的。 ASP非常有限。 ASP.Net是无限的。 ASP几乎没有或没有编程模型。
ASP.Net有一个高度结构化的编程模型。

换句话说,只是试图翻译。 ASP进入ASP.Net是一项徒劳的练习。你可能会成功,但你会在你的应用程序的生命周期中后悔。而不是翻译,我强烈建议重新设计。

-
HTH,

Kevin Spencer
Microsoft MVP
..Net开发人员
你所寻求的是什么。

randyr < RA **** @ online.nospam>在消息中写道
新闻:9E ********************************** @ microsof t.com。 ..



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...

我正在开发一个基于以前的asp应用程序的asp.net应用程序。

在asp应用程序global.asa文件中我有几个

< object id =" id" RUNAT = QUOT;服务器"范围= QUOT;范围"类= QUOT; comclass">应用程序用来加速某些全局级别数据访问和功能的对象的标签。

我已经在.net中重新编写了类库并希望完成<在asp.net中具有相同的功能。

在我看到的例子中你仍然可以使用
< object id =" id" RUNAT = QUOT;服务器"范围= QUOT;范围" global.asax中的class =" Class Name">
标签,但所有这些示例似乎都没有使用global.asax文件包含全局类定义的代码隐藏模型:

Public Class Global
继承System.Web.HttpApplication
...

如何创建applcation级别对象以及如何在 webform使用新模型?


-
randyr
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




如果你已经研究过OOP和ASP.Net,那么你应该意识到,ASP.Net中的所有内容都是一个类。您将以相同的方式使用您的类

您使用System.String或任何其他类。参考它,并使用它。使用它

与global.asax类没有任何关系。


-

HTH,


Kevin Spencer

Microsoft MVP

..Net开发人员

你所寻求的是你得到的。 />

" randyr" < RA **** @ online.nospam>在消息中写道

news:86 ********************************** @ microsof t.com ...
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...
哦,我已经使用oop重新设计了。我仍然希望有一个
应用程序级别的复杂对象,我存储应用程序级数据,集合......
这是真正的问题。

凯文斯宾塞写道:
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:
>如何创建applcation级别对象以及如何访问它们
>在
>使用新模型的webform?
> how do I create my applcation level objects and how do I access them
> in a
> webform using the new model?



这可能听起来很糟糕,我当然习惯被这种描述所称,但是... ... />
1.学习面向对象的编程概念
2.学习ASP.Net对象模型
3.根据OOP,ASP.Net应用程序评估您的需求 4.使用OOP原理设计对象模型
5.编写应用程序

这就是为什么:ASP.Net和ASP在<方法论。 ASP是程序性的。 ASP.Net是面向对象的。 ASP非常有限。 ASP.Net是无限的。 ASP几乎没有或没有编程模型。
ASP.Net有一个高度结构化的编程模型。

换句话说,只是试图翻译。 ASP进入ASP.Net是一项无用的练习。你可能会成功,但你会在你的应用程序的生命周期中后悔。而不是翻译,我强烈建议重新设计。

-
HTH,

Kevin Spencer
Microsoft MVP
..Net开发人员
你所寻求的是什么。

randyr < RA **** @ online.nospam>在消息中写道
新闻:9E ********************************** @ microsof t.com。 ..



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...

>我正在开发一个基于以前的asp应用程序的asp.net应用程序。
>
>在asp应用程序global.asa文件中我有几个
>
> < object id =" id" RUNAT = QUOT;服务器"范围= QUOT;范围"类= QUOT; comclass">标签
>应用程序用于加速某些全局级数据访问的对象和
>功能性。
>
>我已经在.net中重新编写了类库并想要完成
>
>在asp.net中具有相同的功能。
>
>在示例中我看到你仍然可以使用
> < object id =" id" RUNAT = QUOT;服务器"范围= QUOT;范围" class =" Class Name">
>在global.asax中的标签,但所有这些例子似乎都没有使用
>代码隐藏
> global.asax文件包含
>的类定义的模型全球:
>
> Public Class Global
>继承System.Web.HttpApplication
> ......
>
>如何创建applcation级别对象以及如何访问它们
>在
>使用新模型的webform?
>
> thx
>
>
> -
> randyr
>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




这篇关于global.asax中的服务器端对象标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆