用户目录应当重新使用,以便正确使用,因此,你应当利用用户目录的一项活动,即:
public NewTextEventArgs : EventArgs
{
public NewTextEventArgs(string newText)
{
_newText = newText;
}
public NewText
{
get { return _newText; }
}
}
接着,在“用户”上添加以下活动:
public event OnNewText NewText;
public delegate void OnNewText(object sender, NewTextEventArgs e);
接着从用户控制处向活动开火:
private void NotifyNewText(string newText)
{
if (NewText != null)
{
NewText(this, new NewTextEventArgs(newText));
}
}
之后,就在你的网页和用户目录和网页上消费这一活动已不再是紧凑的:
随后处理此事,并将案文提交给你的Label:
protected void YourControl1_NewText(object sender, NewTextEventArgs e)
{
Label1.Text = e.NewText;
}