Visual Studio .NET - Encode URL in asp net 2 0

Asked By abc V on 04-Nov-05 10:52 AM
Hi all,

I was wondering how do i encode the URL in does it need any decoding again coz the flow of the aspx pages depends on the Qery strings sent. Thanks in advance. All help is great help.


An example - Asked By Aarthi Saravanakumar on 04-Nov-05 11:00 AM

string str="Cat&Dog";

In webForm1, you can access Cat&Dog as 


HttpUtility UrlEncode - Asked By F Cali on 04-Nov-05 11:03 AM

Hi Radhika,

You can use the HttpUtility.UrlEncode to encode your query string, as follows:

Dim query As String = "City=" & _
   query += "&Hotel=" & _
   query += "&Date=" & _
   query += "&NumberDays=" & _
   Response.Redirect("Reservation1.aspx?" + query)

Hope this helps.

URL Encode Links - Asked By F Cali on 04-Nov-05 11:04 AM

Hi Radhika,

Here's a couple of links regarding URL encode:

Hope this helps.
URL Encode - Asked By Sameer Jain on 05-Nov-05 10:01 AM
have a look at these