日期:2014-05-18  浏览次数:20447 次

vs2003事件問題
在ide環境中明明有了一事件,可為什么編輯就是不執行?
以下為事件且存在InitializeComponent()
private   void   txtaddressbh_TextChanged(object   sender,   System.EventArgs   e)
{      
if(this.txtaddressbh.Text== " ")
  {JScript.Alert( "物料類型編號為空! ");return;}
}
private   void   InitializeComponent()
{        
this.txtwllxbh.TextChanged   +=   new   System.EventHandler(this.txtwllxbh_TextChanged);
this.txtaddressbh.TextChanged   +=   new   System.EventHandler(this.txtaddressbh_TextChanged);
this.BtnRset.Click   +=   new   System.Web.UI.ImageClickEventHandler(this.BtnRset_Click);
this.Load   +=   new   System.EventHandler(this.Page_Load);

}



------解决方案--------------------
没有回发,建议直接使用javascript 处理。
------解决方案--------------------
事件比较难;我老是弄不清楚;
学习...
------解决方案--------------------
如果是希望改变文本筐的值就回发并触发事件,那有没有设置AutoPostBack属性为true