I have a site that external sites link to with a campaign ID
http://www.example.com?cid=123
or (with a slash)
http://www.example.com/?cid=123
In case you skip the slash, most browsers will go off and add it for you. So, anyway, depending on what you type in the URL of my application, this is the second URL above. The QueryString parameter is always available.
I observed with ASP.NET MVC routing (perhaps even without) that when I use a virtual directory, I do not get the same behavior.
For example, if I have it 'http://www.example.com/virtualdirectory?cid=123', it will reach my " default.aspx" page (since it does not match any route). BUT, when I check the value Request.QueryString, it is empty. If I go to 'http://www.example.com/virtualdirectory?cid=123', then the value is QueryStringpresent in the object Request.
If I put a breakpoint in Default.aspx.csthe newly created MVC project (RTM version of MVC 1.0 - March 2009), then I will not see any query parameters.
I was wondering if there is a way to access these options in IIS6 and / or IIS7 if the user accesses the virtual directory using a URL, for example /virtualdirectory?cid=123.
There can be no solution, but I'm glad I noticed this before linking any partners to a virtual directory!