0

This is my Query string URL

http/test.com/VoucherToHotel.aspx?Hotel_Name=Biverah%20Hotel%20&%20Suites&Ckeck_In=11/05/2014

my problem is when i retrieve Hotel_Name. Hotel name is "Biverah Hotel & Suites"

string Hotel_Name = Request.QueryString["Hotel_Name"];
string Check_In = Request.QueryString["Ckeck_In"];

But string Hotel_Name value is only "Biverah Hotel". its not showing "& Suites". Is querySrting not Support "&" or how i get "&" value.

string Check_In is fine.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Shiv
  • 77
  • 2
  • 15
  • it's asp.net, so http://stackoverflow.com/questions/16622504/escaping-ampersand-in-url does not really apply – stombeur Apr 15 '14 at 13:54

1 Answers1

5

You have to encode the '&' in the query, like you encode ' ' (space character) as %20. Use %26 : http://p2p.wrox.com/html-code-clinic/5699-ampersand-query-string.html

Boluc Papuccuoglu
  • 2,318
  • 1
  • 14
  • 24