Hi,
Some characters have special meanings and would cause confusion in a URL
which may result in the data being misinterpreted.
URL encoding is a way of providing a code to represent the textual
Use HttpUtility.UrlEncode( StringToEncode ); to encode data to post
myString = "Name=" + HttpUtility.UrlEncode( "doe" );
myString += "&SurName=" + HttpUtility.UrlEncode( "john" );
Use HttpUtility.UrlDecode( urlToDecode ); to decode data to post
in ASP.net: HttpServerUtility.UrlEncode
String MyURL;
MyURL = "http://www.contoso.com/articles.aspx?title = ASP.NET Examples";
Response.Write( "<A HREF = " + Server.UrlEncode(MyURL) + "> ASP.NET
Examples <br>" );
//NB: MyURL will be encoded as
"http%3a%2f%2fwww.contoso.com%2farticles.aspx%3fti tle+%3d+ASP.NET+Examples"
instead of
"http%3a%2f%2fwww.contoso.com%2farticles.aspx%3fti tle+=+ASP.NET+Examples"
Nicolas Guinet
"Peter Afonin" <pv*@speakeasy.net> a écrit dans le message de news:
uc**************@TK2MSFTNGP14.phx.gbl...
Hello,
I've created the domain registration system in ASP.NET. I'm using
HttpWebRequest to post the data to the registrar's server. So in the Post
string I'm passing the data like name, address, phone number etc.
The only two fields that are causing problems are the phone and fax
fields.
My only guess here is that's because they start with the "+" sign. So the
string looks like this:
strPost=".....&phone=+7 095 2323344&fax=+7 095 7678899&......"
I guess the combination "=+" doesn't work.
The problem is that I must start any phone number with the "+" sign,
otherwise the registrar's system won't accept it. Any substitutes like
Chr(43) do not help here.
Is there a way to deal with this issue? I guess I should be able to pass
any
string, but I had no luck so far.
I would greatly appreciate any help.
Thank you,
--
Peter Afonin