Haz 11 2009

Problem with Request.Querysting and Plus Sybmol (+)

Category: ASP.NETLatif @ 08:00

Merhaba,

Eger GET methodu ile URL den parametre geciriyorsaniz ve parametrenizde arti(+) isareti geciyor ise ASP.NET sayfaniz da bu parametreyi alirken arti(+) isaretinin boslug'a donustugunu goreceksiniz.

Ornegin,

http://localhost/mdweekly/zoekresultaten.aspx?source=Speelgoed-+-Hobby 

Seklinde bir URL iniz varsa

Sayfanizdan Request.QueryString["source"] seklinde almak istediginiz degerin "Speelgoed- -Hobby" seklin de geldigini farkedeceksiniz.

Bunun onune gecmek icin parametreyi asagidaki sekilde alabilirsiniz.

source = System.Web.HttpUtility.UrlEncode(Request.QueryString["source"]);

 

Tags:

Comments

1.
sulumits retsambew sulumits retsambew United States says:

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.

2.
Latif Latif Turkey says:

Thank you for visiting my blog.

3.
sulumits retsambew sulumits retsambew United States says:

I see you are using Blogengine.net
Let me tell you, it is the best... I love it.

4.
Dors Feline Dors Feline United Kingdom says:

I totally agree, great point, well made