This is a migrated thread and some comments may be shown as answers.

MultiSelect submits only one value

1 Answer 631 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
kabbas
Top achievements
Rank 1
kabbas asked on 28 Mar 2013, 08:03 PM
Hello,

I'm experiencing a problem where the multislect submits the value of one item only even if more than one item is selected. Shouldn't it submit all the values delimited by a comma?

Here is my code:

View:
@using (Html.BeginForm("Send", "MultiSelect", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="demo-section">
    <h3 class="title">Select Continents</h3>
    @(Html.Kendo().MultiSelect()
            .Name("multiselect")
            .DataTextField("Text")
            .DataValueField("Value")
            .BindTo(continents)
            .Events(e =>
            {
                e.Change("change").Select("select").Open("open").Close("close").DataBound("dataBound");
            })
    )
</div>
    <input id="sendButton" type="submit" value="   Send   " />
}
Contoller:

public partial class MultiSelectController : Controller
    {
        public ActionResult Events()
        {
            return View();
        }
 
        public ActionResult Send(string multiselect)
        {
            //the string parameter multiselect has only one value even if more than one                      //value is selected
            return View();
        }
    }
Is there something wrong I am doing??

1 Answer, 1 is accepted

Sort by
0
Accepted
kabbas
Top achievements
Rank 1
answered on 29 Mar 2013, 03:40 AM
I figured out my problem, I should use an IEnumerable<string> to receive the values instead of just a string.

Thank you.
Tags
MultiSelect
Asked by
kabbas
Top achievements
Rank 1
Answers by
kabbas
Top achievements
Rank 1
Share this question
or