1.在用户控件Usercontrol1中用一个Label1
2.在aspx中引用为 <uc1:WebUserControl1 id="WebUserControl11" runat="server"></uc1:WebUserControl1>
3 在aspx.cs 中加入: protected WebUserControl1 WebUserControl11;
4 在Button 中加入:
private void Button1_Click(object sender, System.EventArgs e)
{
Label label = (Label)WebUserControl11.FindControl("Label1");
label.Text = "my name is yxx";
}
2.在aspx中引用为 <uc1:WebUserControl1 id="WebUserControl11" runat="server"></uc1:WebUserControl1>
3 在aspx.cs 中加入: protected WebUserControl1 WebUserControl11;
4 在Button 中加入:
private void Button1_Click(object sender, System.EventArgs e)
{
Label label = (Label)WebUserControl11.FindControl("Label1");
label.Text = "my name is yxx";
}
这条在VB上就行不通了,郁闷,同样的这个问题,我把它写入HTML中就可以的