I have an URL of the following manner: //...../controller/action?a=1&a=2&a=3&a=4
Is it possible to make controller to convert a into collection of int
like in the example below:
public ActionResult Action(int[] a) {.....}
I have an URL of the following manner: //...../controller/action?a=1&a=2&a=3&a=4
Is it possible to make controller to convert a into collection of int
like in the example below:
public ActionResult Action(int[] a) {.....}
I don't think we can have multiple query string parameters with the same name. Probably has to be //...../controller/action?a=1,2,3,4
public ActionResult Action(string a)
{
var aStrs = a.Split(',');
var aInts = aStrs.Select(int.Parse).ToList();
}