2014-03-04 16 views
0

我使用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「))

+0

什麼是原始值是不是rEpJZ8IDRfIbFpptDl84瓦特==? –

回答

0

它是正確的。 其他值都在

HttpUtility.UrlDecode(Request.QueryString("pType")) 
+0

解決方案是什麼? – DontVoteMeDown

+0

使用'encodeURIComponent'之前的值是多少? –

相關問題