Bind to a Dictionary of Lists of Lists of Bools with a strongly-typed MVC view by using Checkboxes

前端 未结 2 396
我寻月下人不归
我寻月下人不归 2021-02-04 19:39

I\'m using MVC 4, .Net 4, and Visual Studio 2012.

I\'m trying to use a fairly complex model with one of my views, and I\'m having serious trouble getting it to bind prop

2条回答
  •  悲&欢浪女
    2021-02-04 20:01

    I had to do something like this, and I had to do with the dictionary value in an array of decimals (Dictionary< string, decimal[] >). If it helps, I did like this:

    @foreach (var kvp in Model.MyDictionary)
    {
        
            @kvp.Key
            @for (int i = 0; i < kvp.Value.Count(); i++)
            {
                
                    
                
            }
        
    }
    

提交回复
热议问题