日期:2014-05-18  浏览次数:20408 次

Url参数传递出现中文乱码问题,JAVASCRIPT如何取,急急急——————--------在线等
第一个传递页面的后台代码段
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();
                }
    }
解决此问题先!!

------解决方案--------------------
编码后传啊.或者request.form......把值弄过来,写进隐藏域.让JS操作也行
------解决方案--------------------
CS:UrlEncode(),HtmlEnCode()
JS:escape();unescape();
------解决方案--------------------
js中 encodeURIComponent
------解决方案--------------------
<!--
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 "));
//-->

------解决方案--------------------
中文可以做一下编码
UrlEncode(),HtmlEnCode()

大家帮帮忙,看一下我的问题啊~~
http://community.csdn.net/Expert/topic/5671/5671873.xml?temp=.9969293
------解决方案--------------------
编码问题吧

楼上说了那么多,我还是不明白楼主的意思
------解决方案--------------------
用request取然后放隐藏域里,js在去读隐藏域