随笔-1  评论-0  文章-6  trackbacks-0
  2007年12月11日
 <asp:button   id="BtnSelEmployee"   runat="server"   Text="选择部门员工"></asp:button>  
  pageLoad事件里注册脚本:  
  -------------------------  
  if(!IsPostBack)  
  {  
  //不提交到服务器端  
  BtnSelEmployee.Attributes.Add("onclick","return   checkParent();return   false");  
   
  StringBuilder   build   =   new   StringBuilder();  
  build.Append("function   checkParent(){\n");  
  build.Append("if(document.getElementById(\"TxtParentID\").value.length   ==   0){\n");  
  build.Append("alert(\"请选择要设置的部门!\");\n");  
  build.Append("return   false;}\n");  
  build.Append("var   win   =    
   
  showModalDialog('SetDeptEmployee.aspx?id='+document.getElementById('TxtParentID').value,window,'status:false;dialogWidth:600p  
   
  x;dialogHeight:500px');\n");  
  build.Append("if   (win   !=   null)   window.location.reload();\n");  
  build.Append("return   false;\n");  
  build.Append("}\n");  
                                                          RegisterClientScriptBlock("selDept",build.ToString());  
   
  }  
posted @ 2007-12-11 19:44 zebra 阅读(966) | 评论 (0)编辑 收藏
仅列出标题