设置textbox的autopostback属性为true,然后写它的响应事件

解决方案 »

  1.   

    我的TextBox 在 DataGrid <FooterTemplate> 中, 是寫
    TextChanged(object sender, System.EventArgs e)事件嗎?
      

  2.   

    这个我没有写过,不时太清楚,因为datagrid中的textbox估计与控件还是有点区别的
    等待高手出现吧,不过,你可以搜索一下关于这方面的东西
      

  3.   

    .aspx<FooterTemplate>
    <asp:TextBox AutoPostBack="True" OnTextChanged="doTextChange" ID="ADD_PRNUM" Columns="10" Runat="server" CssClass="TextBox"></asp:TextBox>
    </FooterTemplate>.cs
    public void doTextChanged(object sender, System.EventArgs e)
    {
     ......
    }結果出錯.
    Compilation Error 
    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0117: 'ASP.po_aspx' does not contain a definition for 'doTextChange'Source Error: Line 37:  </ItemTemplate>
    Line 38:  <FooterTemplate>
    Line 39:  <asp:TextBox AutoPostBack="True" OnTextChanged="doTextChange" ID="ADD_PRNUM" Columns="10" Runat="server" CssClass="TextBox"></asp:TextBox>
    Line 40:  </FooterTemplate>
    Line 41:  </asp:TemplateColumn>
     Source File: E:\myweb\webpo\po.aspx    Line: 39 
      

  4.   

    我也試過用JS的OnBlur事件, 可是它只是客戶端事件, 無法訪問數據庫.