我要在GridView的RowCommand事件中实现判断对话框的弹出
选择了确定才执行后面的操作,选择了取消就不在执行
例:
//读取GridView中选中行的关建字段值
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridView1.SelectedIndex = index;      
string UserID = GridView1.SelectedValue.ToString();修改类型
if (e.CommandName == "ModiType")
{
   //要在这进行客户端操作后执行后面的操作
   //如果用confirm函数选择确定后才执行 否则不执行

修改可用点
if (e.CommandName == "ModiDot")
{
  //要在这进行客户端操作后执行后面的操作
  //如果用confirm函数选择确定后才执行 否则不执行
}}解决了就结贴。在线急等

解决方案 »

  1.   

    不是这样子弄的.所先要自己 DataItem_Bound这个事件里给按钮加上 .属性的onclick事件(IE端) 这个事件执行时弹出 confirm
      

  2.   

    在生成datagrid的时候写代码。不是在这里写代码。
      

  3.   

    在itemdatabound事件里面写代码
    在net2003里面是
    用findcontrol方法定位按钮,然后利用按钮的attributes.add("onclick","return confirm(‘’)");
      

  4.   

    net2003是要在itemdatabound事件里面写代码的,不知道2005是不是
      

  5.   

    GridView 添加确认对话框的例子http://aspalliance.com/786
    http://www.techtoolblog.com/archives/adding-a-confirm-javascript-popup-to-net-gridview
    http://blog.devexperience.net/en/7/Confirm_Delete_in_a_GridView.aspxhttp://forums.asp.net/thread/1293482.aspxhttp://www.davidthielen.info/programming/2006/04/delete_confirm_.html