通过后台文件(cs)向页面注册脚本

  protected   void  Page_Load( object  sender, EventArgs e)
    {
        
if ( ! IsPostBack)
        {
            
string  ScriptStirng  =   " <script type='text/javascript' >alert('弹出');</script> " ;
            
if  ( ! IsClientScriptBlockRegistered( " CSscript " ))
            {
                RegisterClientScriptBlock(
" CSscript " , ScriptStirng); 
            }
               
        }
      
    }

你可能感兴趣的:(脚本)