就是在我的程序里,想在删除时加一句JavaScript代码,有一个确定和取消,点确定就可以删除这条数据,所以我在
GridView1_RowDeleting 里面加上这句。。可是怎么样才能得到它返回的是确定还是取消呢?
protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
if (e.Exception == null)
{
MyTools.Msg("删除成功!", this, "Show.aspx");
}
else
{
MyTools.Msg("删除失败!", this);
e.ExceptionHandled = true;
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
Label lbl = (Label)row.FindControl("Label1");
string row = lbl.Text;
}
GridView1_RowDeleting 里面加上这句。。可是怎么样才能得到它返回的是确定还是取消呢?
protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
if (e.Exception == null)
{
MyTools.Msg("删除成功!", this, "Show.aspx");
}
else
{
MyTools.Msg("删除失败!", this);
e.ExceptionHandled = true;
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
Label lbl = (Label)row.FindControl("Label1");
string row = lbl.Text;
}
"' } else {window.location.href='" + strUrl_No + "' };</script>");
怎么样得到它的返回值哦?
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
((LinkButton)e.Row.Cells[删除按钮所在的列号].Controls[0]).Attributes.Add("onclick", "javascript:return confirm('确认要删除吗?')");
}
}
{
//用户点击的是确定
}
else
{
//用户点击的是取消
}