Tuesday, July 27, 2010

Duplicated Page Parameters

I have just wondered what will happen if you set a page parameter twice. It does not seem to be explicitly documented in MSDN (I have not been particularly thorough in my searching), so I have just tried.

Having http://server/page.aspx?myparam=1&myparam=2, it is
"1,2"
that you receive from HttpContext.Current.Request.QueryString["myparam"].

The order seems to be kept, that is you obtain
"2,1"
having request http://server/page.aspx?myparam=2&myparam=1.

No comments: