using System;
using System.Web;
using System.Web.UI;
namespace COCOWO.COMP
{
/**////
/// 一些常用的Js调用
/// 创建时间:2006-8-3
/// 创建者:马先光
///
public class Jscript
{
/**////
/// 弹出javascript小窗口
///
/// 窗口信息
public static void Alert(string message)
{
#region
string js = @"";
HttpContext.Current.Response.Write(js);
#endregion
}
/**////
/// 弹出消息框并且转向到新的URL
///
/// 消息内容
/// 连接地址
public static void AlertAndRedirect(string message, string toURL)
{
#region
string js = "";
HttpContext.Current.Response.Write(string.Format(js, message, toURL));
#endregion
}
/**////
/// 回到历史页面
///
/// -1/1
public static void GoHistory(int value)
{
#region
string js = @"";
HttpContext.Current.Response.Write(string.Format(js, value));
#endregion
}
/**////
/// 关闭当前窗口
///
public static void CloseWindow()
{
#region
string js = @"";
HttpContext.Current.Response.Write(js);
HttpContext.Current.Response.End();
#endregion
}
/**////
/// 刷新父窗口
///
public static void RefreshParent(string url)
{
#region
string js = @"+url+@"""}catch(e){location="""+url+@"""}>";
HttpContext.Current.Response.Write(js);
#endregion
}
/**////
/// 刷新打开窗口
///
public static void RefreshOpener()
{
#region
string js = @"";
HttpContext.Current.Response.Write(js);
#endregion
}
/**////
/// 打开指定大小的新窗体
///
/// 地址
/// 宽
/// 高
/// 头位置
/// 左位置
public static void OpenWebFormSize(string url, int width,int heigth,int top,int left)
{
#region
string js = @"";
HttpContext.Current.Response.Write(js);
#endregion
}
/**////
/// 转向Url制定的页面
///
/// 连接地址
public static void javascriptLocationHref(string url)
{
#region
string js = @"";
js = string.Format(js, url);
HttpContext.Current.Response.Write(js);
#endregion
}
/**////
/// 打开指定大小位置的模式对话框
///
/// 连接地址
/// 宽
/// 高
/// 距离上位置
/// 距离左位置
public static void ShowModalDialogWindow(string webFormUrl, int width, int height, int top, int left)
{
#region
string features = "dialogWidth:" + width.ToString() + "px"
+ ";dialogHeight:" + height.ToString() + "px"
+ ";dialogLeft:" + left.ToString() + "px"
+ ";dialogTop:" + top.ToString() + "px"
+ ";center:yes;help=no;resizable:no;status:no;scroll=yes";
ShowModalDialogWindow(webFormUrl, features);
#endregion
}
public static void ShowModalDialogWindow(string webFormUrl, string features)
{
string js = ShowModalDialogjavascript(webFormUrl, features);
HttpContext.Current.Response.Write(js);
}
public static string ShowModalDialogjavascript(string webFormUrl, string features)
{
#region
string js = @"";
return js;
#endregion
}
}
}
本文作者:佚名 来源:http://www.cnblogs.com/hzuIT/
CIO之家 www.ciozj.com 微信公众号:imciow