Reputation: 13367
I'm using the following jquery multiselect plugin ... How can I grab the selected values server side via asp.net mvc3 within the [HttpPost] ActionResult()?
Upvotes: 0
Views: 1965
Reputation: 19743
You can just have an array as a parameter of your controller method:
[HttpPost]
public ActionResult ActionName(string[] nameOfMultiSelect)
{
....
}
Upvotes: 1
Reputation: 1935
Request["FormElementName"]
Will come through as a comma separated list.
Or if it's in your model you can acccess it via model.FormElementName which would come through as a array of strings or integers depending on your datatype.
Upvotes: 1