我使用encodeURIComponent並將它發送到查詢字符串中,但是當我在asp.net頁面中找到它時,它就發生了變化。這是守則。queerystring中的encodeURIComponent問題
var postType = encodeURIComponent($(obj).parents(".post").attr("data-item-type"));
var postId = encodeURIComponent($(obj).parents(".post").attr("data-item"));
window.location.href = "PostDetail.aspx?" + GetGUID() + '&pId=' + postId + '&pType=' + postType;
,並在asp網頁
在URL它顯示了正確的 「rEpJZ8IDRfIbFpptDl%2B84w%3D%3D & PTYPE = ereq47B7tt0BQMO5nRRbOQ%3D%3D」
但在asp網頁是「rEpJZ8IDRfIbFpptDl 84w ==「之後HttpUtility.UrlDecode(Request.QueryString(」pId「))
什麼是原始值是不是rEpJZ8IDRfIbFpptDl84瓦特==? –