当前位置: 代码迷 >> ASP.NET >> dropdownlist怎么弹出对话框
  详细解决方案

dropdownlist怎么弹出对话框

热度:5733   发布时间:2013-02-26 00:00:00.0
dropdownlist如何弹出对话框?
大家都知道,button按钮可以有多种方法实现当点击按钮时弹出一个confirm对话框。例如给onclick属性加,或者给attribute加。
但是,现在画面有个dropdownlist,把它的autopostback属性设成true后,它会在每次选择的值改变后去执行一次事件并回发页面。这时,想和button一样,在它执行事件,回发页面之前,弹出一个确认对话框。如果点确定则执行事件,如果点取消则什么都不做。
大虾们!要怎么做啊?
跪求!!

------解决方案--------------------------------------------------------
this.ddlColl.Attributes.Add( "onchange ", "return confirm( 'are you sure? '); ");
  相关解决方案