How to convert NameValueCollection to string?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here is my question: Request.QueryString on asp.net is typed as
NameValueCollection. But there is strange behavoir-- I can simply use
Request.QueryString , or public function ToString() to return a
well-formatted string, ie. param1=1&param2=2..., but when use the same code
on other NameValueCollection object, it only return the class name.

I'm wondering 1. how .NET framework achieve this? by adding logic to check
if it's QueryString object ? 2. Is there a simple way,other than looping thru
kind of labor work, to convert a NameValueCollection object to a
well-formatted string ?

Thanks.
 
Back
Top