[DevExpress Support Team: CLONED FROM T251274: TokenBox - Model binding does not work correctly after upgrading the project to version 15.1]
[DevExpress Support team: this comment was created from a creator's answer]
Working correctly Model of IEnumerable type when I submit the form control. But it does not work when I want to bind data Model of IEnumerable type.
Example Url : http://localhost:2799/V1514NotWork
I found viewdata used as a solution, but that it should be used in this way
Model:
C#public class V1514NotWorkViewModel
{
public List<string> Data { get; set; }
}
Controller:public ActionResult Index()
{ V1514NotWorkViewModel defaultViewModel = new V1514NotWorkViewModel(); defaultViewModel.Data = new List<string>(); defaultViewModel.Data.Add("Tag1"); defaultViewModel.Data.Add("Tag2"); defaultViewModel.Data.Add("Tag3"); defaultViewModel.Data.Add("Tag4"); defaultViewModel.Data.Add("Tag5"); ViewData["DataForTokenBox"] = string.Join(",", defaultViewModel); return View(defaultViewModel); }
View:
C#@model DXWebApplicationTokenProblem.Models.V1514NotWorkViewModel
@{
ViewBag.Title = "Index";
}
<h2>Devexpress V.15.1 NotWork</h2>
@using (Html.BeginForm("Submit", "V1514NotWork"))
{
@Html.DevExpress().TokenBoxFor(m => m.Data, settings =>
{
settings.Properties.AllowCustomTokens = true;
}).Bind(ViewData["DataForTokenBox"]).GetHtml()
<br />
<input type="submit" value="Send"/>
}
Hi Volkan,
We need more time to research this issue.
I've reproduced this issue and forwarded it to our developers for further investigation. We will update this report once any news regarding this subject is available.