RepeatイベントOnItemCommmandが行内コントロールを取得する方法
785 ワード
記録して、主にこの文です。TextBox txtNum=e.Item.FindControl(txtNum)as TextBox;
Repeatは本当に強すぎて、とても柔軟です。Repeat以外は使わないです。
Repeatは本当に強すぎて、とても柔軟です。Repeat以外は使わないです。
<table>
<asp:Repeater ID="rptList" runat="server"OnItemCommand="rptList_ItemCommand">
<ItemTemplate>
<tr>
<td><asp:TextBox ID="txtNum" runat="server" Text='<%#Eval("ProNum")%>'></asp:TextBox></td>
<td><asp:Button ID="btnUpdate" runat="server" Text=" "CommandName="update" CommandArgument='<%#Eval("PID") %>' /></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>