I'm attempting to add a search string (e.g. http://stackoverflow.com?this=that
) to a view returned by a controller. This is being used by JS on the page which I can't change, so other ways to transfer the data aren't an option.
Currently I'm just returning View("Page", viewModel);
from my controller, which doesn't seem to allow you to pass anything via the URL.
I tried using return RedirectToAction("a", "b", new { this = that });
but I can't work out how to return the view correctly with both the view model and the URL string.
How would I go about adding on a ?a=b
style string to a returned view?