UserControl可以对托管页面代码隐藏执行某些操作吗

UserControl可以对托管页面代码隐藏执行某些操作吗

本文介绍了UserControl可以对托管页面代码隐藏执行某些操作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有一个带有几个文本框和几个按钮的UserControl

(保存和取消按钮) )。这个按钮的Click事件当然是在

UserControl的代码隐藏中,所以这是我的问题。


一旦UserControl被删除在容器页面上,我如何从用户控件的代码隐藏处对容器页面的代码隐藏执行某些操作?b $ b $ User例如,假设UserControl在容器页面上的Multiview控件的一个Views中被删除了

。通过

点击取消按钮UserControl的按钮,我想更改容器页面的Multiview控件的

活动视图。


如何在ASP中完成.NET 2.0?


提前致谢,


-Benton

Hi there,

I have a UserControl with a couple of textboxes and a couple of buttons
("Save" and "Cancel"). The Click event for this buttons is in the
UserControl''s codebehind of course, so here''s my question.

Once the UserControl is dropped onto the container page, how can I perform
some action on the codebehind of the container page from the codebehind of
the UserControl? For instance, suppose that the UserControl is dropped
inside one of the Views of a Multiview control on the container page. By
clicking the "Cancel" button of the UserControl, I would like to change the
active view of the container page''s Multiview control.

How can this be done in ASP.NET 2.0?

Thanks in advance,

-Benton

推荐答案





实际上它正好相反:我希望UserControl告诉其容器

页面在某些事情发生时做某事。在UserControl本身,

即,当一个按钮在用户控件上点击
时,容器页面应该切换活动视图。


感谢任何提示,


-Benton

Actually it''s the opposite: I want the UserControl to tell its container
page to do something when "something happens" in the UserControl itself,
i.e., the container page should switch the active view when a button is
clicked on the UserControl.

Thanks for any hint,

-Benton


这篇关于UserControl可以对托管页面代码隐藏执行某些操作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 21:02