如何找到文本框的GridView控件从的尾行中的C#ASP.NET的价值 [英] How to find the value of textbox from the footer row of gridview in C# ASP.NET

查看:187
本文介绍了如何找到文本框的GridView控件从的尾行中的C#ASP.NET的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

        <FooterTemplate>
            <asp:TextBox ID="txtSName" runat="server" Text=""/>
        </FooterTemplate>

和codebehind code是:

and the codebehind Code is as:

TextBox txtName = (TextBox)(GridView1.FooterRow.FindControl("txtSName"));
string aa=txtName.Text;

每次 AA

这code I M投入如下:

this code i m putting into the following:

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
}  

请帮我..........

Please help me..........

推荐答案

试试这个code它可能工作:

Try This code it might work:

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            TextBox txtName = GridView1.FooterRow.FindControl("txtSName") as TextBox;
            string aa = txtName.Text;
        }

这篇关于如何找到文本框的GridView控件从的尾行中的C#ASP.NET的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆