1 public class CallBackPostStar : WebControl, ICallbackEventHandler, INamingContainer 2 { 3 //... 4 5 #region ICallbackEventHandler 成員 6 public string GetCallbackResult() 7 { 8 return Score.ToString(); 9 }10 11 public void RaiseCallbackEvent(string eventArgument)12 {13 Score = Convert.ToInt32(eventArgument);14 EnsureChildControls();15 //這里保存不了控件狀態(tài),例如16 Table table = this.Controls[0] as Table;17 TableCell cell = table.Rows[0].Cells[1];18 cell.Text = Score; 19 //該怎么解決? 20 }21 #endregion22 }
在自定義控件中繼承ICallbackEventHandler
幕布斯7119047
2018-08-22 10:06:46