最好是在控件裡增加一個public的屬性通路
public string LabelText
{
get{return this.Label1.Text;}
}
如果你現在不能改寫控件了,那麼用FindControl也可以:
Label lbl = (Label)WebUserControl1.FindControl("Label1");
使用者屬性或是查找控件。
最好是在控件裡增加一個public的屬性通路
public string LabelText
{
get{return this.Label1.Text;}
}
如果你現在不能改寫控件了,那麼用FindControl也可以:
Label lbl = (Label)WebUserControl1.FindControl("Label1");
使用者屬性或是查找控件。