前臺傳遞參數:
window.location.href = GetPageName() + "?category_id=" + _category_id + "&recommend=" + _recommend + "&Word=" + encodeURI(encodeURI(_word));
word是中文,客戶端編碼兩次,服務端解碼一次
C#代碼:
_word = HttpUtility.UrlDecode(Request["word"], System.Text.Encoding.UTF8);
前臺獲取uri字符串需解碼:
_word = GetQueryString("word") == null ? "" : GetQueryString("word");
$("#text_query").val(decodeURI(_word));
原文來自:點擊打開鏈接
新聞熱點
疑難解答