<asp:GridView ID="gridView" runat="server" OnRowCommand="gridView_RowCommand"> <Columns> <asp:TemplateField HeaderText="输入信息"> <ItemTemplate> <asp:TextBox ID="tbx" runat="server" TextMode="MultiLine" Width="200px" Height="50px"></asp:TextBox> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> protected void gridView_RowCommand(object sender, GridViewCommandEventArgs e) { string tbx = ((TextBox)gridView.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("tbx")).Text; }
原文:https://www.cnblogs.com/liuguiqing/p/15233387.html