vs2005的OnClientClick功能,vs2003怎样实现??

解决方案 »

  1.   

     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
              e.Row.Attributes.Add("ondblclick", "ReKey('" + e.Row.Cells[0].Text +"')");
             // e.Row.AttribOnRowDataBoundutes["style"] = "Cursor:hand";
                // //键盘事件   OnRowCreated="GridView1_RowCreated"
              //        OnRowDataBound="GridView1_RowDataBound">
               // e.Row.Attributes.Add("OnKeyDown", "GridViewItemKeyDownEvent('" + e.Row.Cells[1].Text + "')");
              //if (e.Row.Attributes.Keys[0] == "ondblclick")
              //{
              //    Response.Write("<script>alert('双击');</script>");
              //}          //Session["User_Card"] = e.Row.Cells[0].Text.ToString();
              //Response.Write("<script>alert('" + Session["User_Card"].ToString() + "');</script>");
            }
        }
      

  2.   

    不管页面调用多少次,还是会执行Page_load事件的if (!IsPostBack)里面的语句是什么原因??
      

  3.   

    btn.Attributes.Add("onclick","return cofrim('确认删除吗?')");//btn代表你服务器button按钮
      

  4.   


    LZ一定是给服务端控件绑定客户端事件后,没有返回false。
    例如,给某button绑定某客户端事件时要写成5楼的样子:Return 方法名();
    然后在JavaScript的方法中最后要返回false。
      

  5.   


    //在后台增加属性:
    控件ID.Attributes.Add("onclick","javascript:js函数();");