Здравствуйте, я не могу predenrmi все значения флажков на экране.
Позвольте мне объяснить, у меня есть 5 флажков для примера 2 расширены, а не другие Я хотел бы массив со всеми 5 флажками, включая 2 true и другие false
Кто-то может мне помочь.
Тем временем я пытался создать другую систему, которую создал.
public class PresenzaAO
(
public List <Presenti> listapresenti = new List <Presenti> ();
public string conteggiototale (get;)
public long idalunno (get;)
public string radio (get;)
)
public class Present
(
public string presents{get;set;}
)
and then in the view I created this:
<% Using (Html.BeginForm (ModificaPresenzaAlunno "," Presence ", FormMethod.Post))
(%>
<% = Html.Hidden ( "conteggiototale" Viewdata [ "conteggiototale"])%>
<% = Html.Hidden (idalunno "Viewdata [" student "])%>
<table>
<tr>
<td>
<% = Html.Encode (nomealunno)%>
</ td>
<td>
<% = Html.Encode (cognomealunno)%>
</ td>
<%
if (Viewdata [ "conteggio_presenze"]. ToString () == Viewdata ["conteggiototale"]. ToString ())
(%>
<td>
Absent
<input type = "radio" name = "radio" checked = "checked" id = "assente_"
onclick = "getassentemod (<% = Viewdata [" student "]%>, 0);" value = "true_assente" />
This
<input type = "radio" name = "radio" id = "presente_" value = "false_presente"
onclick = "getassentemod (<% = Viewdata [" student "]%>, 0);" />
</ td>
<% Int i = 0;%>
<% Foreach (var p in (List <PresenzaAlunnoOra>) Viewdata [ "presenze_alunno"])
(
i + = 1;
%>
<td>
<input type = "checkbox" id = "check_ <% = Viewdata [" student "] %><%= i%>" value ="<%= i%> "name =" Present "
onclick = "modificapresenzaalunno (this);" />
</ td>
<%)%>
<%)
else
(%>
<td>
Absent
<input type = "radio" value = "false_assente" name = "radio" id = "assente_ <% = Viewdata [" student "]%>"
onclick = "getassentemod (<% = Viewdata [" student "]%>, 0);" />
This
<input type = "radio" value = "true_presente" name = "radio" checked = "checked" id = "presente_ <% = Viewdata [" student "]%>"
onclick = "getpresentemod (<% = Viewdata [" student "]%>, 0);" />
</ td>
<% Int i = 0;%>
<%
foreach (var p in (List <PresenzaAlunnoOra>) Viewdata [ "presenze_alunno"])
(
i + = 1;
if (p.presente == true)
(
%>
<td>
<input type = "checkbox" id = "check_ <% = Viewdata [" student "] %>,<%= i%>" name = "Present"
checked = "checked" value ="<%= i%> "onclick =" modificapresenzaalunno (this); "/>
</ td>
<%)
else
(%>
<td>
<input type = "checkbox" id = "check_ <% = Viewdata [" pupil "]%>,<%= i%> "value ="<%= i%>" name = "Present"
onclick = "modificapresenzaalunno (this);" />
</ td>
<%)%>
<%)%>
<%)%>
</ tr>
</ table>
<input type="submit" id="btnupdatealunni" value="modifica presenze" />
<%)%>
</ asp: Content>
Поместите в контроллер параметр присутствия
Я прочитал все параметры, кроме флажка