后台调用前台的JS代码并传参数给前台

  void gridView_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string id = DataBinder.Eval(e.Row.DataItem, "id").ToString();
                e.Row.Attributes.Add("style", "cursor:pointer");
                e.Row.Attributes.Add("onclick", string.Format("test('{0}',this)", id));    //调用前台的test
            }
        }
原文地址:https://www.cnblogs.com/xiaobaigang/p/821218.html