How to convert NameValueCollection to string?

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.
 

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

Top