ASP.NET MVC + Checkbox how to proceed?

Asked

Viewed 208 times

1

I have a list where I register FOOTBALL TEAMS in CHAMPIONSHIPS, I mean, I need to select several teams for a championship, I make a list with checkbox but 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 administrator accesses the championship page below shows the teams that are allocated according to the code above, and an option to update if a team is in the championship or not, how can I do this? what to send to the controller?

Let’s say, you’ve got two teams down, and I want to score two more teams, like I would do this?

Another situation has 2 teams marked, and I want to clear the same, as I would do this?

OBS: I have a table called alocar_campeonato, where I allocate the championship id, and the team id to validate q the team is in the championship.

I am used Asp.net MVC + Entity framework

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.