MVC and positional parameters in a query string
- by Pete Nelson
This is more of a question to satisfy my curiosity vs something I really need answered. Back in ASP.NET WebForms, I'd occasionally use a positional parameter in a query string if I only had to pass one thing to a page. For example:
http://localhost/site/MyPage.aspx?ABCD1234
Then my code would look like this:
string accountNumber = "";
if (Request.QueryString.Count > 0)
accountNumber = Request.QueryString[0];
In MVC, can you pass a positional query string parameter to a controller method instead of accessing it through Request.QueryString?