如何在gridview中调用文本框的文本更改事件. [英] How to call text changed event of textbox in gridview.

查看:71
本文介绍了如何在gridview中调用文本框的文本更改事件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是lakshmana rao.
我的网页具有如下所示的gridview

Hello, I am lakshmana rao.
my web page having an gridview just as below

<pre lang="c#"> <asp:GridView ID="GridView2" runat="server" ShowFooter="True" CssClass="grid"
                AutoGenerateColumns="False" 
                 onrowcreated="GridView2_RowCreated" CellPadding="4" ForeColor="#333333" 
                 GridLines="None" Width="100%">
                  <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField HeaderText="S.NO" DataField="s.NO" />                     
                <asp:TemplateField HeaderText="Task">
               <ItemTemplate>
                   <asp:TextBox ID="TextBox2" runat="server" OnTextChanged=TextBox2_textchanged" CssClass="gridtextbox">
</asp:TextBox>
</Columns>   
 </asp:GridView>


并且我想编写"text_changed"事件.
并在代码后面编写代码,如下所示...


and i want to write event of "text_changed".
and write code behind code as follows...

<pre lang="c#">
protected void TextBox4_leave(object sender, EventArgs e)
{

}


但是更改文本后不会触发此事件.
因此,请为我找到解决方案...


but this event is not fired when the text changed.
so please find me the solution...

推荐答案

您所引用的代码背后的方法是 TextBox4_leave .您想用 TextBox2_textchanged 方法编写代码.
The method in the code behind that you are referencing is TextBox4_leave. You want to write the code in the TextBox2_textchanged method.


<asp:TextBox ID="TextBox2" runat="server" OnTextChanged=TextBox2_textchanged" CssClass="gridtextbox">
</asp:TextBox>



设置AutoPostBack ="true"



set AutoPostBack="true"


这篇关于如何在gridview中调用文本框的文本更改事件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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