I want to do this, but I want to also be able to pass in arrays into the query string. I\'ve tried things like:
http://www.sitename.com/route?arr[]=this&
I had to do something similar to this, but instead of strings, i used a list of long to pass some id for a search. Using a multiple select option, the chosen values are sent to the method (via get) like this:
[HttpGet("[action]")]
public IActionResult Search(List idsSelected)
{
///do stuff here
}
I also use Route("[controller]") before the class declaration. Works just fine, but the list of items is broken into multiple parameters in the url, as shown below.
http://localhost:5000/Search/idsSelected=1&idsSelected=2