Handling Multiple QueryString Parameters With the Same Key in ASP.NET

C# No Comments »

When you are processing an HTTP request in ASP.NET you can retrieve the user-provided query string parameters using the HttpRequest.QueryString property.  This property is an instance of the NameValueCollection class.

If the user has provided multiple parameters with the same key in the query string, HttpRequest.QueryString[key] will return all the values concatenated together with commas.  If you would rather process the values individually, use HttpRequest.QueryString.GetValues(key), which will return an array of all the provided values.

For example:

URL: http://example.com?a=1&a=2
HttpRequest.QueryString["a"] = "1,2"
HttpRequest.QueryString.GetValues("a") = { "1", "2" }

Might and Magic 2

General No Comments »

imageI spent many weeks of my childhood, along with a substantial portion of last weekend, playing Might and Magic 2, which I purchased in a bundle from GOG.com.

Fond memories.

Fun Illusion

General No Comments »

Stare at the red dot at the center of this image for a minute or two:

troxler.jpg

What I’m Reading

General No Comments »
The Affluent Society The Affluent Society by John Kenneth Galbraith
The Amazing Adventures of Kavalier & Clay The Amazing Adventures of Kavalier & Clay by Michael Chabon
Godel, Escher, Bach: An Eternal Golden Braid Gödel, Escher, Bach: An Eternal Golden Braid by Douglas R. Hofstadter
Damned Lies and Statistics: Untangling Numbers from the Media, Politicians, and Activists Damned Lies and Statistics: Untangling Numbers from the Media, Politicians, and Activists by Joel Best
A Short History of Nearly Everything A Short History of Nearly Everything by Bill Bryson
Beautiful Architecture: Leading Thinkers Reveal the Hidden Beauty in Software Design Beautiful Architecture: Leading Thinkers Reveal the Hidden Beauty in Software Design by Diomidis Spinellis, Georgios Gousios
A Random Walk Down Wall Street: The Time-Tested Strategy for Successful Investing (Revised and Updated) A Random Walk Down Wall Street by Burton G. Malkiel
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in