Thanks for Gregory's input.
Hello Param,
I think this problem you met is related to the html url encoding.
Yes, you're right that there are some particular characters that must be
encoded when being embeded in url string(in the querystring value). This
is because there are some chars which has their reserved usage. for
example, as a typical url with querystring as below:
http://website/app/test.aspx?id=xxxx&name=xxxx
The "&" and "=" character has their particular usage in querystring (to
separate multi querystring items and separate key and value of each item).
Thus, when such characters occur in our querystring item's value, we need
to escape them.
However, the escape format for url string is not like the one you
mentioned:
&---> & (this is used in XML/HTML document's character escaping)
but like:
&----> %26
because URL encoding rule will escape the original characeter to their hex
value (with a % preceding ). So for the above example, if the "name"
parameter's value contains a "&" char, the escaped (after url encoding) url
will look like:
http://website/app/test.aspx?id=xxxx&name=xx&xx
Here is an article introducing url encoding
#INTRODUCTION TO URL ENCODING
http://www.permadi.com/tutorial/urlEncoding/
#HTML URL-encoding Reference
http://www.w3schools.com/tags/ref_urlencode.asp
Actually, you can even url encode every ascii char in the querystring value
(through this is not necessary). For example, if you use the following url
http:/....../urlstringpage.aspx?name=%26%41%42%43
the server-side component (such as ASP.NET ) can correct decode the value
and get the original querystring:
name= &ABC
If there is anything unclear, please feel free to let me know.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.