ASP.NET页面跳转

代码
     public   static   void  AlertAndBack( string  msg)
    {
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.Write(
" <script>alert(\ ""  + msg.Replace( " \ "" " \\\ "" ) +  " \ " );window.history.back();</script> " );
        HttpContext.Current.Response.End();
    }

    
public   static   void  AlertAndGo( string  msg,  string  gourl,  string  tager)
    {
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.Write(
" <script>alert(\ ""  + msg.Replace( " \ "" " \\\ "" ) +  " \ " );window. "   +  tager  +   " .location.href=' "   +  gourl  +   " '</script> " );
        HttpContext.Current.Response.End();
    }

    
public   static   void  AlertAndRedirect( string  msg,  string  gourl)
    {
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.Write(
" <script>alert(\ ""  + msg.Replace( " \ "" " \\\ "" ) +  " \ " );window.location.href=' "   +  gourl  +   " '</script> " );
        HttpContext.Current.Response.End();
    }

    
public   static   void  AlertAndClose( string  msg)
    {
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.Write(
" <script>alert(\ ""  + msg.Replace( " \ "" " \\\ "" ) +  " \ " );window.close();</script> " );
        HttpContext.Current.Response.End();
    }
    
public   static   void  Alert(System.Web.UI.Page p,  string  msg)
    {
        p.ClientScript.RegisterStartupScript(p.GetType(), 
" alert " " <script>alert(\ ""  + msg.Replace( " \ "" " \\\ "" ) +  " \ " );</script> " );
    }
  
public   static   void  AlertAndRefresh( string  msg)
    {

        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.Write(
" <script>alert(\ ""  + msg.Replace( " \ "" " \\\ "" ) +  " \ " );history.go(-2);window.location.reload(); </script> " );
        
// HttpContext.Current.Response.Write("<script>alert(\"" + msg.Replace("\"", "\\\"") + "\");parent.location.replace('DJIntegralAdmin.aspx'); </script>");
        HttpContext.Current.Response.End();
    }


你可能感兴趣的:(asp.net)