e.Item.Cells(10).Attributes.Add("onclick", "return confirm('您确定要删除这一项吗?');")
写在DataGrid1_ItemDataBound中
把delete语句写在DeleteCommand中

解决方案 »

  1.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=81277B42-361C-4FAB-9A1E-B661ABE517F5
    http://dotnet.aspx.cc/ShowDetail.aspx?id=D4F5E756-0D33-402D-B40D-48E657BD3D4F
      

  2.   

    1:confirm();
    2:alert();
    ------------
    因为是客户端控制,所以只能用javascript;
      

  3.   

    弹出提示框Page.RegisterStartupScript("check", "<script>alert('成功删除!');</script>")
    Response.Write("<script>alert('你输入的用户名或密码错误!');</script>")
    botton1.Attributes.Add("onclick", "return confirm('您确定要删除');")
    e.Item.Cells[1].Attributes.Add("onclick","javascript:return window.confirm('确定要返回吗?');");
      

  4.   

    Page.RegisterStartupScript("check", "<script>alert('成功删除!');</script>")
      

  5.   

    Response.write("<script>alert("+dddd.text+");</script>");
      

  6.   

    就是客户端脚本完成的用JS的alert()就可以 :)
      

  7.   

    同意一楼:
    e.Item.Cells(10).Attributes.Add("onclick", "return confirm('您确定要删除这一项吗?');")
      

  8.   

    <asp:TemplateColumn>
    <HeaderTemplate>&nbsp; 删除 &nbsp;</HeaderTemplate>
    <ItemTemplate>
    <center>
    <asp:ImageButton id="btnDelete" CommandName="Delete" ImageUrl="../Images/Delete.gif" AlternateText="删除" Runat="Server" /></center>
    </ItemTemplate>
    </asp:TemplateColumn>
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 
    {
    ImageButton btnDelete = (ImageButton)e.Item.FindControl("btnDelete");
    btnDelete.Attributes.Add("onclick",String.Format("return confirm('你确定删除 \"{0}\" section?')", sectionName));
    }
      

  9.   

    Response.Write("<script> alert('Invalid Account')</script>");
      

  10.   

    e.Item.Cells(10).Attributes.Add("onclick", "return confirm('您确定要删除这一项吗?');")
    写在DataGrid1_ItemDataBound中
    把delete语句写在DeleteCommand中
      

  11.   

    window.alert("您确定要删除这一项吗?")
      

  12.   

    '自定义的模仿JS的Alert弹出框
    '在页面中的使用方法:Alert("show me the money", Me.Response)
    Public Sub Alert(ByVal Message As String, ByVal CurPageResponseObject As HttpResponse)
                Dim tmpStr As String = String.Format("<script language=javascript>alert('{0}')</script>", Message)
                CurPageResponseObject.Write(tmpStr)
            End Sub
      

  13.   

    在客户端可以直接用msgbox
    在服务端加response.write ......