我无法从 gridview 的页脚行获取文本框的值
<asp:GridView ID="GridView1" runat="server" Width="1214px"
AutoGenerateColumns="False" ShowFooter="true"
OnRowCommand="GridView1_RowCommand"
<Columns>
<asp:TemplateField HeaderText="Insert">
</asp:TemplateField>
<asp:TemplateField HeaderText="Student Name">
<EditItemTemplate>
<asp:Label ID="lblEditSName" runat="server" Text='<%#Eval("sname") %>'/>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblSName" runat="server" Text='<%#Eval("sname") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtSName" runat="server"/>
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
后面的代码是............我无法从gridview的页脚行中获取文本框的值
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName==("AddNew"))
{
TextBox txtName =(TextBox) GridView1.FooterRow.FindControl("txtSName");
string strName=txtName.Text; //strName is Empty while i m enters data into the textbox txtSName
}