AB Vyas
AB Vyas

Reputation: 2389

How to pass Special Character in query string using asp.net and jquery?

I wanna pass %20 in Query string. But in code behind it will considered as space in code behind.

How can i do that?

I am passing querystring using asp.net and also from javascript.

Please help me out for the same. Thanks in advance.

Upvotes: 3

Views: 2667

Answers (2)

Kaushik
Kaushik

Reputation: 356

When you pass value from Asp.net code behind use Server.UrlEncode(%20)

When you pass value from JavaScript use encodeURIComponent('%20') (which will yield %2520)

Upvotes: 5

punund
punund

Reputation: 4421

Pass %2520 to escape your %, that's how.

Upvotes: 2

Related Questions