首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

后盾调用js

2013-04-21 
后台调用js原本的程序是 function doubleclick() {var job_id, cid, cust_id, fromjob_id document.getE

后台调用js
本的程序是
 

function doubleclick() {

            var job_id, cid, cust_id, from;
            job_id =document.getElementById("Label1").innerText;
            cid = document.getElementById("Label2").innerText;
            cust_id = document.getElementById("Label3").innerText;
            from = "";
            OpenJob(job_id, cid, cust_id, from);
       
        }
        
        
        function OpenJob(jobid,cid,cust_id,from)
        {
        }

我想改成后台调用js,
protected void btn_jump_Click(object sender, EventArgs e)
    {
        string job_id, cid, cust_id, from;
        job_id = Label1.Text;
        cid = Label2.Text;
        cust_id = Label3.Text;
        from = "";
     //   Page.RegisterClientScriptBlock("OpenJob", "<script>OpenJob("+job_id+", "+cid+", "+cust_id+", "+from+")</script>");
     //   this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script>OpenJob(" + job_id + ", " + cid + ", " + cust_id + ", " + from + ");</script>", true);
    //    Page.ClientScript.RegisterStartupScript(GetType(), "OpenJob", "OpenJob(" + job_id + ", " + cid + ", " + cust_id + ", " + from + ");", true);
        ClientScript.RegisterStartupScript(ClientScript.GetType(), "OpenJob", "<script>OpenJob(" + job_id + ", " + cid + ", " + cust_id + ", " + from + ");</script>");
  //     Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>OpenJob(job_id, cid, cust_id, from)</script>", true);
   //    Page.RegisterStartupScript("OpenJob", "<script>OpenJob(job_id, cid, cust_id, from)</script>");
     //   OpenJob(job_id, cid, cust_id, from);

    }

结果程序怎么都不对。直觉告诉我应该是调用js的时候参数传递的那段语句写错了。。。
菜鸟求指导应该怎么写。。。。。 js
[解决办法]
Button1.Attributes.Add("onclick", "doubleclick()");

热点排行