Query String Encoding

Posted by Dotnetrajanikanth under ASP.NET on 5/16/2012 | Points: 10 | Views : 3175 | Status : [Member] | Replies : 4
Dear Frnds,

I am facing problem in encoding query string.

My Code Is Like This

window.location = '../Blogging/Article.aspx?Article=' + encodeURI(postID);

This is a javascript code. I want to encode the query string. The methods encodeURI and encodeURIComponent are not working. Please provide a solution for that.

____________
www.flickr.com/photos/psdesigner/



Responses

Posted by: Somasundaram on: 5/16/2012 [Member] Starter | Points: 25

Up
0
Down

Use this while passing Query String:

Server.UrlEncode(PostID)




Dotnetrajanikanth, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kavi.Sirius on: 5/17/2012 [Member] Starter | Points: 25

Up
0
Down
hi

try this code,

Response.Redirect("default.aspx?data=" + HttpUtility.UrlEncode(value));


Regards
Kavi.n

Dotnetrajanikanth, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dotnetrajanikanth on: 5/17/2012 [Member] Starter | Points: 25

Up
0
Down
Actually i need encoding in javascript and decoding in VB.net code behind.

I got the solution for encoding.. but now i am not able to decode

____________
www.flickr.com/photos/psdesigner/

Dotnetrajanikanth, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kavi.Sirius on: 5/17/2012 [Member] Starter | Points: 25

Up
0
Down
hi
Refer this link
http://msdn.microsoft.com/en-us/library/ms150046.aspx#Y800

Regards
Kavi.n

Dotnetrajanikanth, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response