谢谢。

解决方案 »

  1.   

      <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                            OnClientClick="return confirm('确认要删除吗?如果删除,在这个职位的员工所有信息将一起删除');" Text="删除"></asp:LinkButton>
                                    </ItemTemplate>
      

  2.   

    使用的是ASPxGridView自带的删除按钮DeleteButton
      

  3.   

    protected void GridViews_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        这里加入
        if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
                {
                    e.Item.Attributes.Add("onmouseover", "color=this.style.backgroundColor;this.style.backgroundColor='#669988'");
                    e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor=color");
                    ((LinkButton)(e.Item.Cells[3].Controls[0])).Attributes.Add("onclick", "return confirm('你确定要删除此信息吗?');");
                }
    }
      

  4.   

    在删除按钮的那一列属性里面,把DeleteText属性设为
     <div id="de" onclick="JavaScript:return confirm('确定删除吗?')">删除</div>
      

  5.   

    如果你用的是aspxGridView自带的删除的话可以这样操作右键->属性->settings->SettingsBehavior->ConfirmDelete 将属性值设为True
    然后 在Settings->SettingsText->ConfirmDelete 将属性设为你的提示文字 如"确定要删除吗?"能否解决???
      

  6.   

    要看你的ASPxGridView具体是什么版本。
    我的9.3.4是这样做的:
    步骤一:步骤二:
      

  7.   

    如果是AspxGridView自带的删除按钮,那么11楼的解决办法完全够用。如果你用的是自定义按钮,要自定义完成删除动作,那么就需要自己定制按钮列,并在服务器端的CustomButtonCallback事件中书写删除代码。在这种情况下要实现删除确认,需要:在AspxGridView的Client-Side Event中(在aspxGridView的任务菜单中可以找到)设置CustomButtonClick事件代码如下:function(s, e) {
    grid.SetFocusedRowIndex(e.visibleIndex);
    e.processOnServer = true; if(e.buttonID == "DeleteRecord")
    if(!confirm('该操作无法恢复,您确认执行删除吗?'))
    e.processOnServer = false;
    }其中grid为AspxGridView的ClientInstanceName。几个有用的链接:
    1、Question Details: CustomButtonCallback confirm Delete
    2、ASPxClientGridView.CustomButtonClick Event