ASP.NET应用程序 - 定义??? [英] ASP.NET Application - Defined???

查看:61
本文介绍了ASP.NET应用程序 - 定义???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法理解ASP.NET应用程序边界。这是我的设置:


1.带有IIS 6的Win2003服务器和在根SalesNow中定义的应用程序。 ( www.salesnow.com)


2.根目录下的Default.aspx,用户将用户重定向到Pages / Main.aspx。使用javascript window.location。


3.在Pages / Main.aspx页面上的一个HyperLink控件,我添加了一个javascript onclick事件,它可以实现


以下:

- NewLeadWin = window.open(" NewLeads.aspx"," NewLeadWin"," width = 700,height = 500,location = no,top = 20, left = 20,menubar = no,status = no,toolbar = no,scrollbars = yes,resizable = yes");

- NewLeadWin.window.focus();


场景:

1.当Default.aspx包含window.location =''/ Salesow / Pages / Main.aspx''" NewLeadWin工作得很好,但会话状态不会被传输。跟踪必须在root和/ pages中运行才能获得输出。


2.当Default.aspx包含window.location =''/ Pages / Main.aspx'时" NewLeadWin没有给出关于WEB的常见错误.CONFIG:在应用程序级别之外使用注册为allowDefinition =''MachineToApplication'的部分是错误的。


注意:进入Main .aspx没问题,但NewLeads.aspx的开放是。


问题:我认为在应用程序文件夹内部和下面定义的所有内容(本例中为wwwroot)都是


被视为应用程序的一部分。为什么会出现这种情况?

I am having trouble understanding the ASP.NET application boundaries. Here''s my setup:

1. Win2003 Server with IIS 6 and an application defined at the root "SalesNow" (www.salesnow.com).

2. A Default.aspx at the root which redirects the user to "Pages/Main.aspx" using javascript window.location.

3. On the Pages/Main.aspx page a HyperLink control which I add a javascript onclick event which does the

following:
- NewLeadWin = window.open("NewLeads.aspx", "NewLeadWin", "width=700, height=500, location=no, top=20, left=20, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes");
- NewLeadWin.window.focus();

Scenarios:
1. When the Default.aspx contains "window.location = ''/Salesnow/Pages/Main.aspx''" the NewLeadWin works just fine, yet, the session state is not transferred. Trace must be run in both the root and /pages to get output.

2. When the Default.aspx contains "window.location = ''/Pages/Main.aspx''" the NewLeadWin fails giving the familiar error regarding WEB.CONFIG: It is an error to use a section registered as allowDefinition=''MachineToApplication'' beyond application level.

Note: getting to Main.aspx is no problem, but the opening of the NewLeads.aspx is.

Question: I thought everything defined within and below the application folder (wwwroot in this case) was

considered part of the app. Why is this behavior so?

推荐答案

这听起来像是在混淆Session和Application状态。这两个页面

都在同一个应用程序中。但是,一个应用程序可以包含许多

会话,每个客户端浏览器一个。


-

HTH,
Kevin Spencer

..Net开发人员

微软MVP

我得到了很高的报酬

解决难题为生活


Steve Taylor <再************ @ laborready.com>在消息中写道

新闻:#Y ************** @ TK2MSFTNGP11.phx.gbl ...

我遇到了麻烦理解ASP.NET应用程序的界限。

这是我的设置:


1.带有IIS 6的Win2003服务器和在根目录下定义的应用程序

" SalesNow" ( www.salesnow.com)


2.根目录下的Default.aspx,使用javascript window.location将用户重定向到Pages / Main.aspx




3在Pages / Main.aspx页面上的一个HyperLink控件,我添加了一个javascript

onclick事件,其中包含:

以下内容:

- NewLeadWin = window.open(NewLeads.aspx,NewLeadWin,width = 700,

height = 500,location = no,top = 20,left = 20 ,menubar = no,status = no,toolbar = no,

scrollbars = yes,resizable = yes");

- NewLeadWin.window.focus();


场景:

1.当Default.aspx包含window.location =

''/ Salesnow / Pages / Main时的.aspx '' " NewLeadWin工作得很好,但是,

会话状态不会被转移。跟踪必须在root和

/页面中运行才能获得输出。


2.当Default.aspx包含window.location =时'/Pages/Main.aspx''"

NewLeadWin未能提供有关WEB的常见错误.CONFIG:使用注册为<的部分时出现错误


allowDefinition =''MachineToApplication''超出应用程序级别。


注意:进入Main.aspx没问题,但是打开了

NewLeads.aspx是。


问题:我认为在应用程序内部和下面定义的所有内容

文件夹(在本例中为wwwroot)是


被视为应用程序的一部分。为什么会出现这种情况?
It sounds like you''re mixing up Session and Application state. Both pages
ARE in the same application. However, a single Application can contain many
Sessions, one per client browser.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Steve Taylor" <Re************@laborready.com> wrote in message
news:#Y**************@TK2MSFTNGP11.phx.gbl...
I am having trouble understanding the ASP.NET application boundaries.
Here''s my setup:

1. Win2003 Server with IIS 6 and an application defined at the root
"SalesNow" (www.salesnow.com).

2. A Default.aspx at the root which redirects the user to "Pages/Main.aspx"
using javascript window.location.

3. On the Pages/Main.aspx page a HyperLink control which I add a javascript
onclick event which does the

following:
- NewLeadWin = window.open("NewLeads.aspx", "NewLeadWin", "width=700,
height=500, location=no, top=20, left=20, menubar=no, status=no, toolbar=no,
scrollbars=yes, resizable=yes");
- NewLeadWin.window.focus();

Scenarios:
1. When the Default.aspx contains "window.location =
''/Salesnow/Pages/Main.aspx''" the NewLeadWin works just fine, yet, the
session state is not transferred. Trace must be run in both the root and
/pages to get output.

2. When the Default.aspx contains "window.location = ''/Pages/Main.aspx''"
the NewLeadWin fails giving the familiar error regarding WEB.CONFIG: It is
an error to use a section registered as
allowDefinition=''MachineToApplication'' beyond application level.

Note: getting to Main.aspx is no problem, but the opening of the
NewLeads.aspx is.

Question: I thought everything defined within and below the application
folder (wwwroot in this case) was

considered part of the app. Why is this behavior so?


访问Pages文件夹时出现的错误是因为您在该文件夹中包含了一个包含应用程序级别定义的web.config文件(表单)例如,身份验证设置。

在应用程序文件夹内部和下面定义的所有内容(在本例中为wwwroot)都被视为应用程序的一部分,但是诸如您在页面中放置在web.config中的定义要求它是一个单独的ASP.NET应用程序...

要解决这个问题,你需要在IIS属性对话框中将Pages文件夹定义为一个应用程序。


Eran Kampf
http://www.ekampf.com

Steve Taylor <再************ @ laborready.com>在消息新闻中写道:%2 **************** @ TK2MSFTNGP11.phx.gbl ...

我无法理解ASP.NET应用程序边界。这是我的设置:


1.带有IIS 6的Win2003服务器和在根SalesNow中定义的应用程序。 ( www.salesnow.com)


2.根目录下的Default.aspx,用户将用户重定向到Pages / Main.aspx。使用javascript window.location。


3.在Pages / Main.aspx页面上的一个HyperLink控件,我添加了一个javascript onclick事件,它可以实现


以下:

- NewLeadWin = window.open(" NewLeads.aspx"," NewLeadWin"," width = 700,height = 500,location = no,top = 20, left = 20,menubar = no,status = no,toolbar = no,scrollbars = yes,resizable = yes");

- NewLeadWin.window.focus();


场景:

1.当Default.aspx包含window.location =''/ Salesow / Pages / Main.aspx''" NewLeadWin工作得很好,但会话状态不会被传输。跟踪必须在root和/ pages中运行才能获得输出。


2.当Default.aspx包含window.location =''/ Pages / Main.aspx'时" NewLeadWin没有给出关于WEB的常见错误.CONFIG:在应用程序级别之外使用注册为allowDefinition =''MachineToApplication'的部分是错误的。


注意:进入Main .aspx没问题,但NewLeads.aspx的开放是。


问题:我认为在应用程序文件夹内部和下面定义的所有内容(本例中为wwwroot)都是


被视为应用程序的一部分。为什么会出现这种情况?

The error you are getting when accessing the Pages folder is because you included a web.config file in that folder that conatins application level definitions (forms authentication settings for example).
Everything defined within and below the application folder (wwwroot in this case) is considered part of the app but definitions such as the ones you put on the web.config in Pages require it to be a seperate ASP.NET application...
To solve the problem you need to define the Pages folder as an application in the IIS properties dialog.

Eran Kampf
http://www.ekampf.com

"Steve Taylor" <Re************@laborready.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
I am having trouble understanding the ASP.NET application boundaries. Here''s my setup:

1. Win2003 Server with IIS 6 and an application defined at the root "SalesNow" (www.salesnow.com).

2. A Default.aspx at the root which redirects the user to "Pages/Main.aspx" using javascript window.location.

3. On the Pages/Main.aspx page a HyperLink control which I add a javascript onclick event which does the

following:
- NewLeadWin = window.open("NewLeads.aspx", "NewLeadWin", "width=700, height=500, location=no, top=20, left=20, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes");
- NewLeadWin.window.focus();

Scenarios:
1. When the Default.aspx contains "window.location = ''/Salesnow/Pages/Main.aspx''" the NewLeadWin works just fine, yet, the session state is not transferred. Trace must be run in both the root and /pages to get output.

2. When the Default.aspx contains "window.location = ''/Pages/Main.aspx''" the NewLeadWin fails giving the familiar error regarding WEB.CONFIG: It is an error to use a section registered as allowDefinition=''MachineToApplication'' beyond application level.

Note: getting to Main.aspx is no problem, but the opening of the NewLeads.aspx is.

Question: I thought everything defined within and below the application folder (wwwroot in this case) was

considered part of the app. Why is this behavior so?


我希望这很容易!正如你所看到的,我在描述这种奇怪的行为时遇到了麻烦。在这条赛道上开始我的想法是想要在defaut.aspx(一次性

网关到应用程序)初始化我的会话业务对象。

。以下是它今天的工作方式:

- 用户通过超链接(使用窗口链接)从我们的内部网(经典asp)app

链接到Default.aspx。打开)。

- Global.asax Session_Start创建并将用户的骨架

业务对象存储到会话状态(ServerState)。

- 然后Default.aspx只是验证他们来自哪里(必须

是内网网址)并转发他们&他们的ID到pages / main.aspx。

- 然后Main.aspx做了总线obj用户验证并填写了剩余的

对象值。


今天这个都很好用,但是我想将用户验证

移回Default.aspx,然后在会话中更新存储的对象,然后

将它们转移到Main.aspx。在每种形式中,我实例化总线对象(在
init上)并完成工作。关于这个的好处是,我可以检测每个Form Load事件的会话超时(基于空值)和

处理与其他错误不同的时间。


简单地将总线obj验证例程移回Default.aspx导致

对象在到达Main.aspx页面时缺少这些值? ?

当然Default.aspx在应用程序根目录中,而Main.aspx在子文件夹中

(页面),但为什么会导致会话出现问题州?


史蒂夫


" Kevin Spencer" < KS ****** @ takempis.com>在消息中写道

新闻:例如************** @ TK2MSFTNGP15.phx.gbl ...
I wish it were that easy! As you can see, I am having trouble just
describing this strange behavior. What started me on this track was wanting
to initialize my session business object at the Defaut.aspx (one-time
gateway to the app). Here''s how it works today:
- A user is linked to the Default.aspx from our intranet (classic asp) app
via a hyperlink (using window.open).
- The Global.asax Session_Start creates and stores the user''s skeleton
business object into session state (ServerState).
- Then the Default.aspx simply validates where they were coming from (has to
be the intranet url) and transferrs them & their ID to pages/main.aspx.
- Then Main.aspx did the bus obj user validation and filled out the rest of
the object values.

This is all working nicely today, but I want to move the user validation
back to Default.aspx and then update the stored object in session, then
transfer them to Main.aspx. In each form, I instantiate the bus object (on
init) and do the work. The great thing about this is that I can detect when
their session times out (based on null values) on each Form Load event and
handle differently from other errors.

Simply moving the bus obj validation routine back into Default.aspx causes
the object to be missing those values upon getting to the Main.aspx page????
Sure the Default.aspx is in the apps root and Main.aspx is in a sub-folder
(pages), but why would that cause an issue with session state?

Steve

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:eg**************@TK2MSFTNGP15.phx.gbl...
听起来像你' '混合会话和应用程序状态。两个页面
都在同一个应用程序中。但是,一个应用程序可以包含
多个Sessions,每个客户端浏览器一个。

- HTH,
Kevin Spencer
.Net Developer 我得到了很高的钱来解决生活中的谜题

史蒂夫泰勒 <再************ @ laborready.com>在消息中写道
新闻:#Y ************** @ TK2MSFTNGP11.phx.gbl ...
我无法理解ASP.NET应用程序的界限。
这是我的设置:

1.带有IIS 6的Win2003服务器和在根目录定义的应用程序
SalesNow ( www.salesnow.com)

2. A根目录下的Default.aspx将用户重定向到
Pages / Main.aspx使用javascript window.location。

3.在Pages / Main.aspx页面上,我添加了一个
javascript onclick事件的HyperLink控件,其中包含以下内容:


- NewLeadWin = window.open(" NewLeads.aspx"," NewLeadWin"," width = 700,
height = 500,location = no,top = 20,left = 20, menubar = no,status = no,
toolbar = no,scrollbars = yes,resizable = yes");
- NewLeadWin.window.focus();

场景:<当Default.aspx包含window.location =
/Salesnow/Pages/Main.aspx''" NewLeadWin工作得很好,但是,
会话状态不会被转移。 Trace必须在root和
/ pages中运行才能获得输出。

2.当Default.aspx包含window.location =''/ Pages / Main.aspx'时'"
NewLeadWin没有给出关于WEB的常见错误。确认:在应用程序级别之外使用注册为
allowDefinition =''MachineToApplication'的部分是错误的。

问题:我认为在应用程序内部和下面定义了所有内容
文件夹(在本例中为wwwroot)被认为是应用程序的一部分。为什么会出现这种情况?
It sounds like you''re mixing up Session and Application state. Both pages
ARE in the same application. However, a single Application can contain many Sessions, one per client browser.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Steve Taylor" <Re************@laborready.com> wrote in message
news:#Y**************@TK2MSFTNGP11.phx.gbl...
I am having trouble understanding the ASP.NET application boundaries.
Here''s my setup:

1. Win2003 Server with IIS 6 and an application defined at the root
"SalesNow" (www.salesnow.com).

2. A Default.aspx at the root which redirects the user to "Pages/Main.aspx" using javascript window.location.

3. On the Pages/Main.aspx page a HyperLink control which I add a javascript onclick event which does the

following:
- NewLeadWin = window.open("NewLeads.aspx", "NewLeadWin", "width=700,
height=500, location=no, top=20, left=20, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes");
- NewLeadWin.window.focus();

Scenarios:
1. When the Default.aspx contains "window.location =
''/Salesnow/Pages/Main.aspx''" the NewLeadWin works just fine, yet, the
session state is not transferred. Trace must be run in both the root and
/pages to get output.

2. When the Default.aspx contains "window.location = ''/Pages/Main.aspx''"
the NewLeadWin fails giving the familiar error regarding WEB.CONFIG: It is
an error to use a section registered as
allowDefinition=''MachineToApplication'' beyond application level.

Note: getting to Main.aspx is no problem, but the opening of the
NewLeads.aspx is.

Question: I thought everything defined within and below the application
folder (wwwroot in this case) was

considered part of the app. Why is this behavior so?



这篇关于ASP.NET应用程序 - 定义???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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