[JS] JavascriptHelp (转载)
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls; /// <summary>
/// 开发人:苏飞
/// 开发时间:2009-09-02
/// 主要功能:JavaScript弹出对话框以及跳转
/// </summary>
namespace BaseFunction
{
public class JavascriptHelp
{
public JavascriptHelp()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public static void Create()
{
System.Web.HttpContext.Current.Response.Write("<SCRIPT type=\"text/javascript\">");
} public static void Dispose()
{
System.Web.HttpContext.Current.Response.Write("</SCRIPT>");
}
/// <summary>
/// 显示对话框
/// </summary>
/// <param name="strMsg">显示信息</param>
public static void GoTo(string strMsg, string strPath)
{
Create();
if ((strPath == "") || (strPath == null))
{
System.Web.HttpContext.Current.Response.Write(" alert(\"" + strMsg + "\");history.go(-1);");
}
else
{
System.Web.HttpContext.Current.Response.Write("alert('" + strMsg + "');location.href='" + strPath + "';");
}
Dispose();
System.Web.HttpContext.Current.Response.End();
}
public static void Alert(string msg)
{
Create();
HttpContext.Current.Response.Write("alert('" + msg + "');");
Dispose();
}
/// <summary>
/// 打开一个新的网页,但不能设置网面的长宽
/// </summary>
/// <param name="strUrl">地址</param>
/// <param name="strPara">页面参数</param>
public static void OpenNewWindow(string strUrl, int width, int height)
{
Create();
HttpContext.Current.Response.Write("var l=(window.screen.width/2)-" + width + "/2;");
HttpContext.Current.Response.Write("var t=(window.screen.height/2)-" + height + "/2;");
HttpContext.Current.Response.Write("window.open(url,'NewWindow','width='" + width + "',height='" + height + "',top='+t+',left='+l+',menubar=no,toobar=no,scrollbars=yes,resizable=no,status=no,loation=no');");
Dispose();
}
/// <summary>
/// 重新定向到一个文件
/// </summary>
/// <param name="strUrl">重新指定路径</param>
public static void Redirect(string strUrl)
{
Create();
System.Web.HttpContext.Current.Response.Write("window.location.href='" + strUrl + "';");
Dispose();
}
}
}
[JS] JavascriptHelp (转载)的更多相关文章
- 移动端下拉刷新,iScroll.js用法(转载)
本文转载自: iScroll.js 用法参考 (share)
- 移动端IOS和androi及浏览器js判断[转载]
转载自:http://www.niutifa.com/?p=561 移动端IOS和androi及浏览器js判断: <script type="text/javascript" ...
- 当Shell遇上了Node.js(转载)
转载:http://developer.51cto.com/art/201202/315066.htm 好吧,我承认,这个标题有点暧昧的基情,但是希望下文的内部能给不熟悉或不喜欢Shell或WIN平台 ...
- 图片攻击-BMP图片中注入恶意JS代码 <转载>
昨天看到一篇文章<hacking throung images>,里面介绍了如何在BMP格式的图片里注入JS代码,使得BMP图片既可以正常显示, 也可以运行其中的JS代码,觉得相当有趣. ...
- javascript深入理解js闭包(转载)
此篇文章来源于http://www.jb51.net/article/24101.htm 一.变量的作用域 要理解闭包,首先必须理解Javascript特殊的变量作用域. 变量的作用域无非就是两种:全 ...
- 两种简单实现菜单高亮显示的JS类(转载)
两种简单实现菜单高亮显示的JS类 近期在写一个博客管理后台的前端,涉及在同一页面两种高亮显示当前菜单的需求.记得当年写静态页时,为了实现高亮都是在每个页面加不同的样式,呵.高亮显示我觉得对于web ...
- Mac 下安装node.js(转载)
原文地址:http://blog.csdn.net/u011619283/article/details/52368759 Node.js 简介 Node.js 是一个用Chrome's V8 Jav ...
- node.js应用--转载
最近,在向大学生们介绍 HTML5 的时候,我想要对他们进行问卷调查,并向他们显示实时更新的投票结果.鉴于此目的,我决定快速构建一个用于此目的的问卷调查应用程序.我想要一个简单的架构,不需要太多不同的 ...
- A re-introduction to JavaScript (JS Tutorial) 转载自:https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
A re-introduction to JavaScript (JS Tutorial) Redirected from https://developer.mozilla.org/en-US/do ...
随机推荐
- 正确使用TeamViewer VPN
http://www.mcbbs.net/thread-222996-1-1.html
- Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS(转)
[-] A What I Am Going To Do B The Setup Steps C Lets Install it A. What I Am Going To Do B. The Se ...
- TOAD Menu Shortcuts 快捷键
TOAD Menu Shortcuts Category Command Shortcut Conflict File AWR Browser File Compare Files File DBMS ...
- ManagerDay-2
新工作开始了两个星期 基本没有什么产出,主要还是适应新岗位和学东西.作为一个由高级开发转初级PM的人,要学要接触的还有太多. 公司给我安排了一个刚刚起步的项目,可能也是我从业三年接触到的最大的一个项目 ...
- POJ 3616 Milking Time (字符串DP)
题意:找元素关于对角线左或右对称的最大矩阵 思路:左右对角线只需要遍历一条就可以了.只要当前点往上遍历和往后遍历一样就可以. #include<iostream> #include< ...
- Stand-up meeting
A stand-up meeting (or simply "stand-up") is a daily team-meeting held to provide a status ...
- phpDesigner 工具快捷键巧用
Zend Studio工具默认的快捷方式, 如果你从事php工作, 自然能够体会到一些便利性, 比如CTRL+D, 可以直接复制当前一行, 这对于重复代码及调试都有很大帮助. Ctrl+U转换大小写之 ...
- pci转并口卡的安装使用
pci转并口卡模拟出来的并口并不能完全等同于主板上真正的并口.真正的并口打印的时候可以“直接瓶口输出”打印,而不需要安装打印驱动程序. 这个模拟出来的并口却不能使用“直接瓶口输出”(打印机不打印,程序 ...
- java第一章到第四章
class HelloWorld{ public static void main(String [] arguments) { System.out.println("Hello Worl ...
- Theano FCN实现与训练经验与教训小结
NaN 计算softmax loss时要用numeric robust 的计算方式. softmax与 loss可能要分开计算. 得到前者的计算方式可以是常规方法. 但计算后者时要注意无穷大和NaN的 ...