ASP.NET MVC + Checkbox how to proceed? [closed]

1

I have a list where you can register a SOCCER TIMES in CHAMPIONSHIPS, that is, I need to select several teams for a league, I make a list with checkboxes but I do not know how to proceed later:

<ul>
                   @foreach (var item in ((List<TCC.Models.time>)ViewData["listTime"]))
                   {
                       foreach (var item2 in ((List<TCC.Models.participante_campeonato>)ViewData["listParticipante"]))
                       {
                           if (item.id_time == item2.id_time) {
                                <label class="col-md-12"><li class="task-normal ui-tooltip" data-toggle="tooltip" data-placement="bottom" data-original-title="Time Alocado"> <input type="checkbox" checked> <span>@item.nome_time</span> </li></label>
                           } else {
                            <label class="col-md-12"><li class="task-important"> <input type="checkbox"> <span>@item.nome_time</span> </li></label>
                           }
                       }
                   }
                </ul>

When the admin accesses the championships page below shows the teams that are allocated according to the code above, and an option to update if a team is or is not in the league, how can I do this? what to send to the controller?

Let's suppose, there are 2 teams scored, and I want to score 2 more teams, how would I do that?

Another situation has 2 teams scored, and I want to clear them, how would I do it?

I have a table called alocar_campeonato, where I allocate the id of the championship, and the id of the team to validate that the team is in the championship.

I'm using asp.net MVC + entity framework

    
asked by anonymous 30.11.2016 / 00:05

0 answers