[c#]récupérer valeur d'un TextBox dans un Repeater
Bonjour,
Dans un Repeater j'ai des contrôles, dont un bouton qui me permet d'exploiter les données du Repeater hors du Repeater grâce au CommandArgument du bouton.
Avec cette technique je cherche à récupérer également la valeur d'un TextBox qui se trouve dans le même Repeater. Et je n'y arrive pas.
Je cherche une instruction du style :
Code:
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id")%>,f_dernierVaccin_m.Text'
Si quelqu'un a une idée ....
Repeater complet :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| asp:Repeater ID="rpt_vaccins" runat="server">
<HeaderTemplate>
<tr bgcolor="WhiteSmoke" style="font-weight: bold; font-size: x-small; color: black">
<td>Germe</td>
<td>Vaccin</td>
<td>Mois dernière vaccination</td>
<td></td>
<td>Année dernière vaccination</td>
<td>Sélectionner</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr bgcolor='<%# DataBinder.Eval(Container.DataItem, "Couleur")%>' style='font-size: x-small;
color: <%# DataBinder.Eval(Container.DataItem, "Couleur_f")%>'>
</tr>
<td><%# DataBinder.Eval(Container.DataItem, "Germe_Nom")%></td>
<td><%# DataBinder.Eval(Container.DataItem, "Vaccin_Nom")%></td>
<td>
<asp:TextBox runat=server ID="f_dernierVaccin_m" MaxLength="2" BackColor="WhiteSmoke" BorderColor="Gainsboro" BorderStyle="Solid" BorderWidth="1"> </asp:TextBox> </td>
<td>/</td>
<td><asp:TextBox runat=server ID="f_dernierVaccin_a" MaxLength="4" BackColor="WhiteSmoke" BorderColor="Gainsboro" BorderStyle="Solid" BorderWidth="1"> </asp:TextBox>
</td>
<td>
<asp:Button ID="btn_rpt_vaccins" runat="server" BackColor="WhiteSmoke" BorderColor="Gainsboro"
BorderStyle="Outset" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id")%>,f_dernierVaccin_m.Text'
Font-Names="Arial Black" Font-Size="X-Small" ForeColor="Black" Height="10" OnCommand="btn_rpt_vaccins_Click" />
</td>
</ItemTemplate>
</asp:Repeater> |