第一个传递页面的后台代码段
ScriptManager.RegisterClientScriptBlock(gvSelPatient, this.GetType(), "AJAXResponseScript", "if(confirm('病人病例信息录入成功,是否直接开药?')){document.location.href='.././Clinic.aspx?PatientID=' + getPatientID() + '&PatientName=' + getPatientName();}", true);其中getPatientID和getPatientName为JS函数。protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["PatientID"] != null && Request["PatientName"] != null)
        {
            url
            //PatientID =Int32.Parse(Request["PatientID"].ToString());
            this.tx_Name.Value = Request["PatientName"].ToString();
        }
  }
解决此问题先!!

解决方案 »

  1.   

    编码后传啊.或者request.form......把值弄过来,写进隐藏域.让JS操作也行
      

  2.   

    CS:UrlEncode(),HtmlEnCode()
    JS:escape();unescape();
      

  3.   

    那我想问现在接收页面如何用JS得到URL里面的参数了
      

  4.   

    JS为什么要URL参数?
    那你就request.form......把值弄过来,写进隐藏域.让JS操作隐藏域.
      

  5.   

    因为我需要那边的ID,由于种种原因只能从脚本获取
    request.form......把值弄过能不能说详细点啊,我是这样想得给隐藏域赋值
      

  6.   

    <!--
    Request(strName){ 
     var strHref = "www.cnlei.org/index.htm?a=aaa&b=bbb&c=ccc"; 
     var intPos = strHref.indexOf("?"); 
     var strRight = strHref.substr(intPos + 1); 
     var arrTmp = strRight.split("&"); 
     for(var i = 0; i < arrTmp.length; i++) { 
     var arrTemp = arrTmp.split("="); 
     if(arrTemp[0].toUpperCase() == strName.toUpperCase()) return arrTemp[1]; 
     } 
     return ""; 
    } alert(Request("a")); 
    alert(Request("b")); 
    alert(Request("c")); 
    //-->
      

  7.   

    难道就没更好点的方法了,网上的方法大体上好像就是这些了,还有就是我这个strHref是链接过来的document.location.href='.././Clinic.aspx?PatientID=' + getPatientID() + '&PatientName=' + getPatientName();}", true);,而且因为用到了框架所以地址栏上依然是http://localhost:4744/Web/Default.aspx
    What can I do?
    Help me !
      

  8.   

    中文可以做一下编码
    UrlEncode(),HtmlEnCode()大家帮帮忙,看一下我的问题啊~~
    http://community.csdn.net/Expert/topic/5671/5671873.xml?temp=.9969293
      

  9.   

    简单来将就是如何在前台脚本中得到PatientID的值
      

  10.   

    用request取然后放隐藏域里,js在去读隐藏域