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