/// <summary>
/// 转向Url制定的页面
/// </summary>
/// <param>连接地址</param>
public static void JavaScriptLocationHref(string url, Page page)
{
#region
string js = @"<Script language='JavaScript'>
window.location.replace('{0}');
</Script>";
js = string.Format(js, url);
//HttpContext.Current.Response.Write(js);
if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "JavaScriptLocationHref"))
{
page.ClientScript.RegisterStartupScript(page.GetType(), "JavaScriptLocationHref", js);
}
#endregion
}
/// <summary>
/// 打开指定大小位置的模式对话框
/// </summary>
/// <param>连接地址</param>
/// <param>宽</param>
/// <param>高</param>
/// <param>距离上位置</param>
/// <param>距离左位置</param>
public static void ShowModalDialogWindow(string webFormUrl, int width, int height, int top, int left, Page page)
{
#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, page);
#endregion
}
/// <summary>
/// 弹出模态窗口
/// </summary>
/// <param></param>
/// <param></param>
public static void ShowModalDialogWindow(string webFormUrl, string features, Page page)
{
string js = ShowModalDialogJavascript(webFormUrl, features);
//HttpContext.Current.Response.Write(js);
if (!page.ClientScript.IsStartupScriptRegistered(page.GetType(), "ShowModalDialogWindow"))
{
page.ClientScript.RegisterStartupScript(page.GetType(), "ShowModalDialogWindow", js);
}
}
// /// <summary>
// /// 弹出模态窗口
// /// </summary>
// /// <param></param>
// /// <param></param>
// /// <returns></returns>
// public static string ShowModalDialogJavascript(string webFormUrl, string features)
// {
// #region
// string js = @"<script language=javascript>
// showModalDialog('" + webFormUrl + "','','" + features + "');</script>";
// return js;
// #endregion
// }
#endregion
}