日期:2014-05-20 浏览次数:20830 次
public event Action<DataTable> SearchCompleted; protected void Page_Load(object sender, EventArgs e) { // 绑定事件处理 mysearch1 += MySearchComplete; } private void MySearchComplete(DataTable dt) { GridView1.DataSource = dt;//此处的值为NULL GridView1.DataBind(); } -------------- 控件的Button事件 -------------------- protected void Search_Click(object sender, EventArgs e) { DataTable mydt = ubDAO.selectall("20");//此处取到了 // 触发这个事件 SearchCompleted(mydt); }
------解决方案--------------------
修改下:
mysearch1.SearchCompleted += MySearchComplete;