文本框textchanged事件未在vs2010中触发 [英] Textbox textchanged event not firing in vs2010

查看:171
本文介绍了文本框textchanged事件未在vs2010中触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:TemplateColumn HeaderText="Amount">
    <itemtemplate>
        <asp:TextBox ID="txtAmount" runat="server" CssClass="txAlign" Width="100px" MaxLength="15" AutoPostBack="true"  OnTextChanged="txtAmount_TextChanged"

             Text='<%# DataBinder.Eval(Container.DataItem,"c5") %>'>
    </itemtemplate>





protected void txtAmount_TextChanged(object sender, EventArgs e)
    {       
        double totalval = 0.00;  
        foreach (DataGridItem item in dgBill.Items)
        {
            if (((TextBox)item.FindControl("txtAmount")).Text!= "")
            {
                totalval = Convert.ToDouble(totalval) + Convert.ToDouble(((TextBox)item.FindControl("txtAmount")).Text);
            }                       
        }
        txtTotAmount.Text = totalval.ToString();        
    }



上面的代码在升级到.net4.0的VS2005中工作正常.我在VS2010中运行了该应用程序,上面的代码未触发,并且未定义"RBS_conrol".



The above code is working fine in VS2005 am upgrading to .net4.0. I ran the application in VS2010, the above code is not firing and got "RBS_conrol" not defined

推荐答案

此代码对我来说似乎很完美.此代码不存在问题.您缺少的其他东西.尝试调试该错误并跟踪错误.还有一件事,请检查您的CssClass="txAlign".


--Amit
This code seems to be perfect to me. Problem is not here with this code. Something else you are missing. Try debugging that and trace the error. One more thing, check your CssClass="txAlign".


--Amit


这篇关于文本框textchanged事件未在vs2010中触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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