0
我已經創建了一個自定義事件來處理如何在我的GridView中更新數據。問題是,它不是射擊。我使用了調試模式,甚至當我單擊更新按鈕時,斷點也不會生效。ASP.Net Gridview更新事件
這裏是事件處理程序我已經寫:
protected void DocView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
var rw = DocView.Rows[e.RowIndex] ;
var Doc = (TextBox)rw.FindControl("DocTB");
var Num = (TextBox)rw.FindControl("NumberTB");
var Iss = (TextBox)rw.FindControl("IssuedTB");
var Exp = (TextBox)rw.FindControl("ExpiryTB");
var Stat = (TextBox)rw.FindControl("StatusTB");
var con = new LinqDBDataContext();
var doc = (from i in con.Documents
where i.DocumentID == e.RowIndex
select i).Single();
doc.DocumentType = Doc.Text;
doc.Number = Num.Text;
doc.Issued = DateTime.Parse(Iss.Text);
doc.Expiry = DateTime.Parse(Exp.Text);
doc.Status = Stat.Text;
con.SubmitChanges();
DocView.EditIndex = -1;
}
的事件就不會火!
您是否在標記中附加事件? – Victor 2011-02-08 18:07:42