gridview更新

问题描述:

不同的警报消息你好家伙我在我的asp.net网站上使用gridview(从obout)。当用户点击编辑时,griview打开并显示点击行的模板。在那里我有一个保存按钮。当用户点击它时,我得到一个简单的JS脚本,弹出一个简单的警报。 我的问题是,现在我需要在不同情况下显示不同的警报。 我试图把该上的更新,而不是事件,但它不会触发:gridview更新

Page.ClientScript.RegisterStartupScript(Me.GetType(), "PopUpWindow", popupscript, False) 

我想找到我怎么能对警报更新事件后,用户将看到完全控制。

你可以处理GridView的RowDataBound事件,尝试使用这个js功能的onclick

protected void Gridview_RowDataBound(object sender, GridViewRowEventArgs e) 
{ 
if (e.Row.RowType == DataControlRowType.DataRow) 
{ 
    // reference the Delete LinkButton 
    LinkButton db = (LinkButton)e.Row.Cells[3].Controls[0]; 

    db.OnClientClick = "return confirm('Are you certain you want to delete this questionnaire?');"; 
} 
} 

(OR)

HERE