+ "Cwin.resizeTo(screen.availWidth-20,screen.availHeight-20);"
+ "
// --></script>";
if (!page.IsClientScriptBlockRegistered("clientScript"))
page.RegisterClientScriptBlock("clientScript", str);
}
else
{
Alert(page, "页面地址不能为空!");
}
}
/// <summary>
///11 静态方法,打开一个IE窗口(无标题栏、工具栏、地址栏等)。
/// </summary>
/// <param name="page">页面对象</param>
/// <param name="URL">页面名称</param>
/// <param name="Width">宽度</param>
/// <param name="Height">高度</param>
/// <example>
/// PublicJS.OpenIEWindow(page,"weihu.aspx",700,350);
/// </example>
public static void OpenIEWindow(System.Web.UI.Page page, string URL, int Width, int Height)
{
if (URL != null)
{
string str = "<script language='javascript'><!--
"
+ "var Cwin=window.open('" + URL + "','','location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + Width + ",height=" + Height + ",left=10,top=10');"
+ "Cwin.moveTo((screen.availWidth-" + Width + ")/2,(screen.availHeight-" + Height + ")/2);"
+ "
// --></script>";
if (!page.IsClientScriptBlockRegistered("clientScript"))
page.RegisterClientScriptBlock("clientScript", str);
}
else
{
Alert(page, "页面地址不能为空!");
}
}
/// <summary>
///12 静态方法,打开一个IE窗口(无标题栏、工具栏、地址栏等)
///在屏幕的最右边,上下满屏,宽度由参数指定。
/// </summary>
/// <param name="page">页面对象</param>
/// <param name="URL">页面名称</param>
/// <param name="Width">宽度</param>
/// <example>
/// PublicJS.OpenIEWindowRight(page,"weihu.aspx",700);
/// </example>
public static void OpenIEWindowRight(System.Web.UI.Page page, string URL, int Width)
{
if (URL != null)
{
if (Width == 0)
{
Alert(page, "页面宽度和高度不能为零!");
return;
}
string str = "<script language='javascript'><!--
"
+ "newwindow=window.open('" + URL + "','','location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + Width + ",height=document.height');"
+ "newwindow.moveTo(screen.width-" + Width + ",0);newwindow.resizeTo(" + Width + ",screen.height);"
+ "
// --></script>";
if (!page.IsClientScriptBlockRegistered("clientScript"))
page.RegisterClientScriptBlock("clientScript", str);
}
else
{
Alert(page, "页面地址不能为空!");
}
}
/// <summary>
///13 静态方法,打开一个IE窗口(无标题栏、工具栏、地址栏等),在屏幕的最右边,上下位置在中间。
/// </summary>
/// <param name="page">页面对象</param>
/// <param name="URL">页面名称</param>








