Problem with Server.UrlEncode

H

Hemant

Hi,
I am encoding a url with Server.UrlEncode. in vb.net 2005 web application
example :
Server.UrlEncode("Test URL:Test Name ")

It encode the url in Test URL%3aTest Name but this give me HTTP Error 400 -
Bad Request.

same happens for "%" character.
How to handle this
Please help me

Thanks,
Hemant
 
S

Sreenivas

Hi,
I am encoding a url with Server.UrlEncode. in vb.net 2005 web application
example :
Server.UrlEncode("Test URL:Test Name  ")

It encode the url in Test URL%3aTest Name  but this give me HTTP Error 400 -
Bad Request.

same happens for "%" character.
How to handle this
Please help me

Thanks,
Hemant

Those special characters (such as colon, semi colon,etc)are not
allowed in the URL ,
see the below URL , though that is Java centric ,you could straight
away understand it.
http://www.javapractices.com/topic/TopicAction.do?Id=96
 
G

Gregory A. Beamer

Hi,
I am encoding a url with Server.UrlEncode. in vb.net 2005 web
application example :
Server.UrlEncode("Test URL:Test Name ")

It encode the url in Test URL%3aTest Name but this give me HTTP Error
400 - Bad Request.

same happens for "%" character.
How to handle this
Please help me

URL encoding is used for arguments, not the actual URL. For example, you
might have a forwarder like:

http://mysite.com/forward.aspx?url=http://www.microsoft.com

Only the argument is url encoded. And, when you actually forward on
forward.aspx, you would decode before doing the response.redirect on the
url.

Peace and Grace,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top