ASP.NET页面跳转
2010-04-20 11:46
1711 查看
代码 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();
}
{
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笔记之页面跳转、调试、form表单、viewstate、cookie的使用说明
- asp.net跳转页面的三种方法比较
- 转:Asp.net中实现页面跳转的三种方法比较,现在总结如下:
- asp.net知识汇总-页面跳转Server.Transfer和Response.Redirect
- asp.net mvc && asp.net 页面跳转
- asp.net跳转页面的三种方法比较
- “asp.net页面跳转”补遗
- asp.net 页面间传值与跳转的区别
- asp.net跳转页面的三种方法比较
- asp.net跳转页面的三种方法比较
- asp.net中实现倒计时自动跳转页面(运用javascript)
- ASP.NET页面跳转相关知识
- ASP.NET中七种页面跳转的方法
- html button 跳转ASP.NET页面跳转技术总结
- ASP.NET实现个人信息注册页面并跳转显示
- 在asp.net 中 如何在登录成功后2秒内自动跳转到登录前的页面
- ASP.NET弹出对话框并跳转页面
- ASP.net页面跳转方式比较
- asp.net跳转页面的三种方法比较
- Asp.net页面跳转方式汇总