In fact, you can capture query strings in MVC in two ways .....
public ActionResult CrazyMVC(string knownQuerystring) {
This will capture both query strings ... for example:
/CrazyMVC?knownQuerystring=123&unknownQuerystring=456 Output: 123 - 456
Don't ask me why they designed it that way. It would be more prudent if they threw out the entire Controller action system for individual query strings and simply returned a captured dynamic list of all strings / encoded file objects for the URL using url-encoding so you can easily access them in one times, Maybe someone here can demonstrate that, if possible?
It doesn't make any sense to me how controllers capture query strings, but that means you have more flexibility to capture query strings than they teach you out of the box. So take your poison .... both work great.
Stokely Jul 03 '17 at 4:25 2017-07-03 04:25
source share