ms_dos

  博客园  :: 首页  :: 新随笔  ::  :: 订阅 订阅  :: 管理

cs:

写在Page_Load 里面
Button1.Attributes.Add("onclick", "return fun(" + TextBox1.ClientID + "," + TextBox2.ClientID + ");");

aspx:
         <script language ="javascript">
                 function fun(tname,tpwd)
                 {
                     if(tname.value=="")
                     {
                           alert("请输入用户名!");
                           return false;                           
                       
                     }
                       if(tpwd.value=="")
                     {
                           alert("请输入密码!");
                           return false;                           
                       
                     }
                 
                 }
         </script>

posted on 2007-07-09 18:33  ms_dos  阅读(498)  评论(0编辑  收藏  举报