![](/img/trans.png)
[英]How to get event control from another aspx Page. button click or Page load | ASP.NET
[英]access click event and control of aspx page from class in asp.net c#
我也遇到了这个问题。 您必须定义正在加载的当前页面。
protected void Page_Load(object sender, EventArgs e)
{
Page page = new Page(); //I think it is Page control. I am not sure right now, I dont have access to the code I made for that right now. But you propably get the main idea.
page=this;
Label c = new Label();
c= Label1; //Might be c= this.Label1
}
然后从课堂上您可以执行以下操作:
page.c.Text="I found you";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.