ページにユーザーコントロールのボタンのイベントを書く

2223 ワード

ユーザーコントロール:
  /// <summary>
///
/// </summary>
public Button SelectFactoryOKButton
{
get { return this.btnChooseOneFactoryOK; }
set { this.btnChooseOneFactoryOK = value; }
}

ユーザーコントロールはそのボタンを公開し、ページには、自分にイベントを追加するページが表示されます.
 this.UCChooseOneFactory.SelectFactoryOKButton.Click += new EventHandler(SelectFactoryOKButton_Click);

 
 protected void SelectFactoryOKButton_Click(object sender, EventArgs e)
{
if (this.UCChooseOneFactory.GetSelectFacotyID().ToString() == "0")
{
MessageBox.Show(this.upSelectProductNamePopup, " !");
}
}

依頼でここを見てみたいhttp://hi.baidu.com/isbx/blog/item/85df08f7ca0fb12a730eec06.html http://www.cnblogs.com/fc5110/archive/2011/06/30/2094940.html