后台弹出操作成功,失败信息

  

         /// <summary>
/// 弹出信息,并跳转指定页面。
/// </summary>
public static void AlertAndRedirect(string message, string toURL)
{
string js = "<script language=javascript>alert('{0}');window.location.replace('{1}')</script>";
HttpContext.Current.Response.Write(string.Format(js, message, toURL));
HttpContext.Current.Response.End();
}
          /// <summary>
/// 弹出信息,并返回历史页面
/// </summary>
public static void AlertAndGoHistory(string message, int value)
{
string js = @"<Script language='JavaScript'>alert('{0}');history.go({1});</Script>";
HttpContext.Current.Response.Write(string.Format(js, message, value));
HttpContext.Current.Response.End();
}
   /// <summary>
/// 直接跳转到指定的页面
/// </summary>
public static void Redirect(string toUrl)
{
string js = @"<script language=javascript>window.location.replace('{0}')</script>";
HttpContext.Current.Response.Write(string.Format(js, toUrl));
}
  /// <summary>
/// 弹出信息 并指定到父窗口
/// </summary>
public static void AlertAndParentUrl(string message, string toURL)
{
string js = "<script language=javascript>alert('{0}');window.top.location.replace('{1}')</script>";
HttpContext.Current.Response.Write(string.Format(js, message, toURL));
} /// <summary>
/// 返回到父窗口
/// </summary>
public static void ParentRedirect(string ToUrl)
{
string js = "<script language=javascript>window.top.location.replace('{0}')</script>";
HttpContext.Current.Response.Write(string.Format(js, ToUrl));
} /// <summary>
/// 返回历史页面
/// </summary>
public static void BackHistory(int value)
{
string js = @"<Script language='JavaScript'>history.go({0});</Script>";
HttpContext.Current.Response.Write(string.Format(js, value));
HttpContext.Current.Response.End();
} /// <summary>
/// 弹出信息
/// </summary>
public static void Alert(string message)
{
string js = "<script language=javascript>alert('{0}');</script>";
HttpContext.Current.Response.Write(string.Format(js, message));
} /// <summary>
/// 注册脚本块
/// </summary>
public static void RegisterScriptBlock(System.Web.UI.Page page, string _ScriptString)
{
page.ClientScript.RegisterStartupScript(page.GetType(), "scriptblock", "<script type='text/javascript'>" + _ScriptString + "</script>");
}

js 后台弹窗的更多相关文章

  1. js解决弹窗问题实现班级跳转DIV示例

    js解决弹窗问题实现班级跳转DIV 1.js代码如下: <%--实现班级跳转DIV--%>  <div id="displayClassDiv" style=&q ...

  2. js写弹窗

    1.先来看弹窗的模样 点击“弹出窗口”后会弹出下面窗口 2.下面是实现弹出窗口的代码,其中引入的jquery一般自己有,没有的话可以从网上下载.tanchuang.js和tanchuang.css写在 ...

  3. js右下角弹窗代码(实测好用)

    实测好用的js右下角弹窗代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt ...

  4. 28个漂亮的React.js后台管理模板

    React管理模板 为您的React Web应用程序开发一个管理区域可能非常耗时.它与设计所有前端页面一样重要. 这是2020年设计出色的顶级React.js后台管理模板的列表. 这些模板确实有价值, ...

  5. 用简单的 Node.js 后台程序浅析 HTTP 请求与响应

    用简单的 Node.js 后台程序浅析 HTTP 请求与响应 本文写于 2020 年 1 月 18 日 我们来看两种方式发送 HTTP 请求,一种呢,是命令行的 curl 命令:一种呢是直接在浏览器的 ...

  6. js广告弹窗

    生活中我们经常遇到一些烦人的广告页面,比方说弹窗,悬浮等等各种广告.有的同事甚至都下一个屏蔽广告插件到浏览器上.这样就防止了广告的干扰. 但是我们学前端的必须是要知道广告弹窗这个做的过程,甚至是它的原 ...

  7. js自定义弹窗

    <一>confirm弹窗 页面操作中常见需要确认操作. 例如:删除某条消息前需要确认是否删除. 页面中弹窗确认操作用到confirm消息对话框. JS代码 function del(){ ...

  8. node.js后台快速搭建在阿里云(一)(express篇)

    前期准备 阿里云服务器 node.js pm2 express nginx linux(推荐教程:鸟哥的私房菜) 简介 嗯……我只是个前端而已 前段时间写过一个.net mvc的远程发布,关于.net ...

  9. node.js后台快速搭建在阿里云(二)(pm2和nginx篇)

    前期准备 阿里云服务器 node.js pm2 express nginx linux(推荐教程:鸟哥的私房菜) 简介 嗯……我只是个前端而已 在第一部分说完了express篇. 后面继续项目的部署, ...

随机推荐

  1. python的一些总结3

    好吧 刚刚的2篇文章都很水.. 这篇 也是继续水 在 templates 右键新建 html 文件:如 index.html (输入以下代码) <!DOCTYPE html> <ht ...

  2. hdu 5587 Array 数学题

    Array Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5587 De ...

  3. iOS开发——语法篇OC篇&高级语法精讲

    高级语法精讲 一.NSSet.NSMutableSet集合的介绍 1)NSSet.NSMutableSet集合,元素是无序的,不能有重复的值. 2)用实例方法创建一个不可变集合对象 例如: //宏定义 ...

  4. Google搜索语法

    原文:http://www.jianshu.com/p/37fe4f1381ef 前言 之前听过一个笑话,有人打开浏览器,输入www.baidu.com, 然后搜索框输入Google,查询google ...

  5. Opacity多浏览器透明度兼容处理(转)

    用来设定元素透明度的 Opacity 是CSS 3里的一个属性.当然现在还只有少部分浏览器支持. 不过各个浏览器都有自己的私有属性来支持,其中包括老版本的Mozilla和Safari: IE: fil ...

  6. DataBase 之 实用积累

    (1)分页:(性能效果最好的是top/max 和Row_number()两种方法) [1]写法1,not in/top select top pagesize * from pagetest wher ...

  7. Last non-zero Digit in N!

    Problem Description The expression N!, read as "N factorial," denotes the product of the f ...

  8. 《JavaScript学习指南》第2版 学习笔记1

    1.<noscript> 标签 noscript 元素用来定义在脚本未被执行时的替代内容(文本). 注释:如果浏览器支持脚本,那么它不会显示出 noscript 元素中的文本.无法识别 & ...

  9. 在openshift上使用django+postgresql

    openshift上用的是django 1.7,数据库选择的是postgresql 9.2 本地开发用的是sqlite3数据库,发布到openshift上后是没有数据的(本地的sqlite3数据库里的 ...

  10. 获取Spring-boot系统环境变量方法

    public static ConfigurableApplicationContext context = null; public static void main( String[] args ...