EG:
1. Button1.Attributes.Add("onClick","return confirm('提示信息')");
2.textbox1.Attributes.Add("onfocus","document.getElementById('textbox2').style.display='');
3.textbox1.Attributes.Add("onblur","document.getElementById('textbox2').style.display='none');
格式:
1。控件.Attributes.add("事件","javaScript脚本");
2。控件.Attributes["事件"]="javascript:return 方法(..)";
(放在Page_Load()中)