0
我有一个GriView实施RowDataBound事件像下面火的JavaScript按钮内部的GridView
protected void gvwSearchResult_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
int index = e.Row.RowIndex;
string IdValue = gvwSearchResult.DataKeys[index].Value.ToString();
Button _btnCheque = (Button)e.Row.FindControl("btnCheque");
_btnCheque .OnClientClick = "<script type='text/javascript'>if(confirm('Do you want to continue?')){window.location='Cheque.aspx?ID=" + IdValue.ToString()+"';}</script>";
}
}
当我点击按钮,就抛出一个脚本错误。任何想法在我的脚本格式?