I want to call an action with something similar to this uri:
http://server/controller/action/?columns=firstname&columns=lastname&columns=age
and use it like this:
public ActionResult Action(string[] columns)
{
}
how do I do it?
Passing Array To The Method In Java To pass an array as an argument to a method, you just have to pass the name of the array without square brackets. The method prototype should match to accept the argument of the array type. Given below is the method prototype: void method_name (int [] array);
Google is my friend ;)
http://server/controller/action/?columns[]=firstname&columns[]=lastname&columns[]=age
Edit:
Actually you just write as I did in my original question. The reason to why I didn't get it working in the first place is that I used "column" in the query string and "columns" in as action parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With