首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

关于textBox控件的TextChanged事件的疑惑,该如何解决

2012-01-30 
关于textBox控件的TextChanged事件的疑惑textBox控件的TextChanged事件如下,请问我怎么在这个函数里获取相

关于textBox控件的TextChanged事件的疑惑
textBox控件的TextChanged事件如下,请问我怎么在这个函数里获取相关textBox控件的text值,sender和e各代表什么意思?

                protected   void   txtBoxName_TextChanged(object   sender,   EventArgs   e)
                {
                       
                     
                       
                }

[解决办法]
textBox控件的text值是:this.textBox控件.Text

sender就是该控件

[解决办法]
sender代表事件源,也就是引发事件的文本框
e 代表事件信息,在此例中用处不大
protected void txtBoxName_TextChanged(object sender, EventArgs e)
{
//这里 ((TextBox)sender).Text 原来文本框的值


}

[解决办法]
protected void txtBoxName_TextChanged(object sender, EventArgs e)
{

this.txb(控件ID).text //取得文本框的直

}

sender 代表事件源 e代表事件信息
一般做分页或删除,等等操作时用到 e, 此处取值用不到

热点排行