处理网页之间的事件.. [英] handling events between webpages..

查看:64
本文介绍了处理网页之间的事件..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在创建一个web应用程序,我的设计要求创建

主要webform,左侧有菜单栏,IFrame有

将包含单击菜单项时显示的所有表单。除此之外

这些我想放置一个自定义状态栏。在任何网页中遇到的任何错误消息

都将显示在横幅中。

我遇到的问题是如何访问客户状态栏

显示在IFRAME中的子表单。我不能使用

HttpApplicationState.Application对象,因为我无法将自定义对象放在

应用程序对象中。那是对的吗?此外,假设我可以在遇到错误时从表单中提升事件

,那么问题是我如何在我的主框架中捕获该事件。我不想在我的主要表单中注册大量的事件

我的应用程序中有大量的对象。由于我不能在这篇文章中附上word文档所以我会尝试使用下面的数字

来证明我打算完成的工作:


主要网页(包含IFRAME,菜单栏,状态栏控制)

________ | _________

| |

Page1第2页(包含webcontrols)

|

Page1.1(包含webcontrols)


假设主网页显示iframe中的page1,当点击某个命令按钮并且页面1.1包含网页用户

控制时,它会显示

page1.1。现在假设用户在webcontrol中遇到了一些错误。我希望

该错误信息显示在主网页的状态栏控件中。

我可以从webcontrol引发错误事件,该事件将由Page 1.1,
剩下的问题是如何将该事件传播到主网页。

关于这种方法的任何建议或任何更好的方法来处理这个问题。我知道有没有办法在网页之间移动控制,但我找不到那个非常优雅的解决方案来解决我的问题。

谢谢

Subhash


-

谢谢

SCS

Hi,
I am working on creating a webapplication and my design calls for creating
main webform which will have menu bar on left hand side and a IFrame which
will contain all the forms that are shown when menu items are clicked.Besides
these i would like to put a custom status bar. Any error message encountered
in any of the webpage will be displayed in the banner.
The problem iam encountering is how to access the customer status bar in
child forms that are displayed in the IFRAME. I cannot use
HttpApplicationState.Application object as i cannot put custom objects in
application object. Is that correct? Also, assuming that i can raise events
from the forms when error is encountered then the question is how do i
capture that event in my main frame. I don''t want to register tons of events
in my main form for tons of objects that are there in my application. Since i
cannot attach word document in this post so i will try use following figure
to demonstrate what i am planning to accomplish:

Main Webpage(contains IFRAME, MENU BAR, STATUS BAR CONTROL)
________|_________
| |
Page1 Page 2(contains webcontrols)
|
Page1.1(contain webcontrols)

Assuming that main webpage shows page1 in the iframe which brings up
page1.1 when some command button is clicked and Page 1.1 contains web user
control. Now assuming user ecounters some error in the webcontrol. I want
that error message to be displayed in the status bar control of Main webpage.
I can raise error event from webcontrol which will be captured by Page 1.1 ,
the problem that remains is how to propogate that event to Main webpage.
Any suggestion on this approach or any better approach to handle this. I
know there is way to move control between webpages but i don''t find that very
elegant solution for my problem.
Thanks
Subhash


--
Thanks
SCS

推荐答案

使用HTMLTable代替框架,放置不同的用户或自定义

控件来实现页面的各个组件。如果你担心在b / b
回发后必须重新创建所有组件的性能,那么请利用ASP.NET中的页面片段缓存功能

2.0。 http://beta.asp.net/QUICKSTART/ aspne ... / fragment.aspx


您是否有任何特殊原因需要使用框架?

-

HTH,

Phillip Williams
http:// www .societopia.net
http://www.webswapp.com

" scsharma"写道:
Instead of frames, use an HTMLTable to place different user or custom
controls that implement the various components of your page. If you are
worried about the performance of having to recreate all components upon
postback then take advantage of the Page fragment caching feature in ASP.NET
2.0. http://beta.asp.net/QUICKSTART/aspne.../fragment.aspx

Are there any particular reasons you want to use frames?
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"scsharma" wrote:

我正在创建一个webapplication,我的设计要求创建
主要webform,左侧有菜单栏, IFrame,它将包含单击菜单项时显示的所有表单。除此之外
这些我想放置一个自定义状态栏。在任何网页中遇到的任何错误消息都将显示在横幅中。
我遇到的问题是如何访问IFRAME中显示的子窗体中的客户状态栏。我不能使用
HttpApplicationState.Application对象,因为我无法将自定义对象放在
应用程序对象中。那是对的吗?此外,假设我可以在遇到错误时从表单中引发事件,那么问题是我如何在主框架中捕获该事件。我不想在我的主要表单中记录大量的事件,以便在我的应用程序中存在大量的对象。由于我无法在这篇文章中附上word文档,所以我将尝试使用下图来展示我打算完成的工作:

主要网页(包含IFRAME,MENU BAR,状态栏控制)
________ | _________
| | Page 1第2页(包含web控件)
|
Page1.1(包含webcontrols)

假设主网页在iframe中显示了第1页当单击某个命令按钮并且页面1.1包含Web用户
控件时,页面1.1。现在假设用户在webcontrol中遇到了一些错误。我希望
该错误信息显示在主网页的状态栏控件中。
我可以从webcontrol中引发错误事件,这将由第1.1页捕获,
仍然存在的问题是如何将该事件传播到主网页。
关于这种方法的任何建议或任何更好的方法来处理这个问题。我知道有办法在网页之间移动控制,但我找不到那个非常优雅的解决方案来解决我的问题。
谢谢
Subhash

-
谢谢
SCS
Hi,
I am working on creating a webapplication and my design calls for creating
main webform which will have menu bar on left hand side and a IFrame which
will contain all the forms that are shown when menu items are clicked.Besides
these i would like to put a custom status bar. Any error message encountered
in any of the webpage will be displayed in the banner.
The problem iam encountering is how to access the customer status bar in
child forms that are displayed in the IFRAME. I cannot use
HttpApplicationState.Application object as i cannot put custom objects in
application object. Is that correct? Also, assuming that i can raise events
from the forms when error is encountered then the question is how do i
capture that event in my main frame. I don''t want to register tons of events
in my main form for tons of objects that are there in my application. Since i
cannot attach word document in this post so i will try use following figure
to demonstrate what i am planning to accomplish:

Main Webpage(contains IFRAME, MENU BAR, STATUS BAR CONTROL)
________|_________
| |
Page1 Page 2(contains webcontrols)
|
Page1.1(contain webcontrols)

Assuming that main webpage shows page1 in the iframe which brings up
page1.1 when some command button is clicked and Page 1.1 contains web user
control. Now assuming user ecounters some error in the webcontrol. I want
that error message to be displayed in the status bar control of Main webpage.
I can raise error event from webcontrol which will be captured by Page 1.1 ,
the problem that remains is how to propogate that event to Main webpage.
Any suggestion on this approach or any better approach to handle this. I
know there is way to move control between webpages but i don''t find that very
elegant solution for my problem.
Thanks
Subhash


--
Thanks
SCS



菲利普。


请记下2.0快速入门的新地址:

http://www.asp.net/QUICKSTART/default.aspx


您引用的特定页面位于:
< a rel =nofollowhref =http://www.asp.net/QUICKSTART/aspnet/doc/caching/fragment.aspx\"target =_ blank> http://www.asp.net/QUICKSTART/aspnet ... / fragment.aspx

beta.asp.net网站很快就会关闭,因为该产品不再处于测试阶段。


Juan T. Llibre,ASP.NET MVP

ASP.NET常见问题解答: http://asp.net.do/faq/

ASPNE TFAQ.COM: http://www.aspnetfaq.com/

Foros de ASP.NET en Espa?ol: http://asp.net。 do / foros /

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

" Phillip Williams" <博士************** @ webswapp.com>在消息中写道

news:7E ********************************** @ microsof t.com ...
Hi, Philip.

Please make a note of the new address for the 2.0 QuickStart :

http://www.asp.net/QUICKSTART/default.aspx

That particular page you cited will be at :
http://www.asp.net/QUICKSTART/aspnet.../fragment.aspx

The beta.asp.net site will go down shortly, as the product is not in beta any more.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espa?ol : http://asp.net.do/foros/
======================================
"Phillip Williams" <Ph**************@webswapp.com> wrote in message
news:7E**********************************@microsof t.com...
使用HTMLTable来放置实现页面各种组件的不同用户或自定义
控件,而不是框架。如果您担心在回发时必须重新创建所有组件的性能,那么请利用ASP.NET中的页面片段缓存功能
2.0。 http://beta.asp.net/QUICKSTART/ aspne ... / fragment.aspx

你想使用框架有什么特别的原因吗?
-
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

" scsharma"写道:
Instead of frames, use an HTMLTable to place different user or custom
controls that implement the various components of your page. If you are
worried about the performance of having to recreate all components upon
postback then take advantage of the Page fragment caching feature in ASP.NET
2.0. http://beta.asp.net/QUICKSTART/aspne.../fragment.aspx

Are there any particular reasons you want to use frames?
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"scsharma" wrote:

我正在创建一个webapplication,我的设计要求创建
主要webform,左侧有菜单栏, IFrame,它将包含单击菜单项时显示的所有表单。除此之外
这些我想放置一个自定义状态栏。在任何网页中遇到的任何错误消息都将显示在横幅中。
我遇到的问题是如何访问IFRAME中显示的子窗体中的客户状态栏。我不能使用
HttpApplicationState.Application对象,因为我无法将自定义对象放在
应用程序对象中。那是对的吗?此外,假设我可以在遇到错误时从表单中引发事件,那么问题是我如何在主框架中捕获该事件。我不想在我的主要表单中记录大量的事件,以便在我的应用程序中存在大量的对象。由于我无法在这篇文章中附上word文档,所以我将尝试使用下图来展示我打算完成的工作:

主要网页(包含IFRAME,MENU BAR,状态栏控制)
________ | _________
| | Page 1第2页(包含web控件)
|
Page1.1(包含webcontrols)

假设主网页在iframe中显示了第1页当单击某个命令按钮并且页面1.1包含Web用户
控件时,页面1.1。现在假设用户在webcontrol中遇到了一些错误。我希望
该错误信息显示在主网页的状态栏控件中。
我可以从webcontrol中引发错误事件,这将由第1.1页捕获,
仍然存在的问题是如何将该事件传播到主网页。
关于这种方法的任何建议或任何更好的方法来处理这个问题。我知道有办法在网页之间移动控制,但我找不到那个非常优雅的解决方案来解决我的问题。
谢谢
Subhash

-
谢谢
SCS
Hi,
I am working on creating a webapplication and my design calls for creating
main webform which will have menu bar on left hand side and a IFrame which
will contain all the forms that are shown when menu items are clicked.Besides
these i would like to put a custom status bar. Any error message encountered
in any of the webpage will be displayed in the banner.
The problem iam encountering is how to access the customer status bar in
child forms that are displayed in the IFRAME. I cannot use
HttpApplicationState.Application object as i cannot put custom objects in
application object. Is that correct? Also, assuming that i can raise events
from the forms when error is encountered then the question is how do i
capture that event in my main frame. I don''t want to register tons of events
in my main form for tons of objects that are there in my application. Since i
cannot attach word document in this post so i will try use following figure
to demonstrate what i am planning to accomplish:

Main Webpage(contains IFRAME, MENU BAR, STATUS BAR CONTROL)
________|_________
| |
Page1 Page 2(contains webcontrols)
|
Page1.1(contain webcontrols)

Assuming that main webpage shows page1 in the iframe which brings up
page1.1 when some command button is clicked and Page 1.1 contains web user
control. Now assuming user ecounters some error in the webcontrol. I want
that error message to be displayed in the status bar control of Main webpage.
I can raise error event from webcontrol which will be captured by Page 1.1 ,
the problem that remains is how to propogate that event to Main webpage.
Any suggestion on this approach or any better approach to handle this. I
know there is way to move control between webpages but i don''t find that very
elegant solution for my problem.
Thanks
Subhash


--
Thanks
SCS



谢谢Juan。

-

Phillip Williams
http:/ /www.societopia.net
http://www.webswapp.com

" Juan T. Llibre"写道:
Thanks Juan.

--
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Juan T. Llibre" wrote:
菲利普。

请记下2.0快速入门的新地址:

http://www.asp.net/QUICKSTART/default.aspx

您引用的特定页面位于:
http://www.asp.net/QUICKSTART/aspnet.../fragment.aspx

beta.asp.net网站将很快关闭,因为该产品不再处于测试阶段。

Juan T. Llibre,ASP.NET MVP
ASP.NET FAQ: http://asp.net.do/faq/
ASPNETFAQ.COM: http://www.aspnetfaq.com/
Foros de ASP.NET en Espa?±ol: http://asp.net.do/foros/ < br => ======================================
Phillip Williams <博士************** @ webswapp.com>在消息中写道
新闻:7E ********************************** @ microsof t.com。 ..
Hi, Philip.

Please make a note of the new address for the 2.0 QuickStart :

http://www.asp.net/QUICKSTART/default.aspx

That particular page you cited will be at :
http://www.asp.net/QUICKSTART/aspnet.../fragment.aspx

The beta.asp.net site will go down shortly, as the product is not in beta any more.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espa?±ol : http://asp.net.do/foros/
======================================
"Phillip Williams" <Ph**************@webswapp.com> wrote in message
news:7E**********************************@microsof t.com...
使用HTMLTable来放置实现页面各种组件的不同用户或自定义
控件,而不是框架。如果您担心在回发时必须重新创建所有组件的性能,那么请利用ASP.NET中的页面片段缓存功能
2.0。 http://beta.asp.net/QUICKSTART/ aspne ... / fragment.aspx

你想使用框架有什么特别的原因吗?
-
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

" scsharma"写道:
Instead of frames, use an HTMLTable to place different user or custom
controls that implement the various components of your page. If you are
worried about the performance of having to recreate all components upon
postback then take advantage of the Page fragment caching feature in ASP.NET
2.0. http://beta.asp.net/QUICKSTART/aspne.../fragment.aspx

Are there any particular reasons you want to use frames?
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"scsharma" wrote:

我正在创建一个webapplication,我的设计要求创建
主要webform,左侧有菜单栏, IFrame,它将包含单击菜单项时显示的所有表单。除此之外
这些我想放置一个自定义状态栏。在任何网页中遇到的任何错误消息都将显示在横幅中。
我遇到的问题是如何访问IFRAME中显示的子窗体中的客户状态栏。我不能使用
HttpApplicationState.Application对象,因为我无法将自定义对象放在
应用程序对象中。那是对的吗?此外,假设我可以在遇到错误时从表单中引发事件,那么问题是我如何在主框架中捕获该事件。我不想在我的主要表单中记录大量的事件,以便在我的应用程序中存在大量的对象。由于我无法在这篇文章中附上word文档,所以我将尝试使用下图来展示我打算完成的工作:

主要网页(包含IFRAME,MENU BAR,状态栏控制)
________ | _________
| | Page 1第2页(包含web控件)
|
Page1.1(包含webcontrols)

假设主网页在iframe中显示了第1页当单击某个命令按钮并且页面1.1包含Web用户
控件时,页面1.1。现在假设用户在webcontrol中遇到了一些错误。我希望
该错误信息显示在主网页的状态栏控件中。
我可以从webcontrol中引发错误事件,这将由第1.1页捕获,
仍然存在的问题是如何将该事件传播到主网页。
关于这种方法的任何建议或任何更好的方法来处理这个问题。我知道有办法在网页之间移动控制,但我找不到那个非常优雅的解决方案来解决我的问题。
谢谢
Subhash

-
谢谢
SCS
Hi,
I am working on creating a webapplication and my design calls for creating
main webform which will have menu bar on left hand side and a IFrame which
will contain all the forms that are shown when menu items are clicked.Besides
these i would like to put a custom status bar. Any error message encountered
in any of the webpage will be displayed in the banner.
The problem iam encountering is how to access the customer status bar in
child forms that are displayed in the IFRAME. I cannot use
HttpApplicationState.Application object as i cannot put custom objects in
application object. Is that correct? Also, assuming that i can raise events
from the forms when error is encountered then the question is how do i
capture that event in my main frame. I don''t want to register tons of events
in my main form for tons of objects that are there in my application. Since i
cannot attach word document in this post so i will try use following figure
to demonstrate what i am planning to accomplish:

Main Webpage(contains IFRAME, MENU BAR, STATUS BAR CONTROL)
________|_________
| |
Page1 Page 2(contains webcontrols)
|
Page1.1(contain webcontrols)

Assuming that main webpage shows page1 in the iframe which brings up
page1.1 when some command button is clicked and Page 1.1 contains web user
control. Now assuming user ecounters some error in the webcontrol. I want
that error message to be displayed in the status bar control of Main webpage.
I can raise error event from webcontrol which will be captured by Page 1.1 ,
the problem that remains is how to propogate that event to Main webpage.
Any suggestion on this approach or any better approach to handle this. I
know there is way to move control between webpages but i don''t find that very
elegant solution for my problem.
Thanks
Subhash


--
Thanks
SCS




这篇关于处理网页之间的事件..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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