I can't get the value of textbox from the footer row of gridview

zemisails

New Member
i can't get the value of textbox from the footer row of gridview\[code\] <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>\[/code\]and the code behind is........i can't get the value of textbox from the footer row of gridview\[code\]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 }\[/code\]
 
Back
Top