Skip to main content
 首页 » 编程设计

c#之如何让页面调用usercontrol

2024年02月24日27lvdongjie

我有一个用户控件。有什么方法可以获取用户控件可用的页面吗?

请您参考如下方法:

在你的用户控件中写这个方法

protected void MyMethod() 
{ 
    Page myParent = this.Page; 
 
    ...  
}