protected void Page_Load(object sender, EventArgs e)
{
}
protected void Page_Unload(object sender, EventArgs e)
{
System.Web.HttpContext.Current.Response.Write("<script language=JavaScript>window.showModalDialog('tx.aspx','window','dialogWidth=565px;dialogHeight=410px');</script>");
}
{
}
protected void Page_Unload(object sender, EventArgs e)
{
System.Web.HttpContext.Current.Response.Write("<script language=JavaScript>window.showModalDialog('tx.aspx','window','dialogWidth=565px;dialogHeight=410px');</script>");
}
{
}
protected void Page_Unload(object sender, EventArgs e)
{
System.Web.HttpContext.Current.Response.Write("<script language=JavaScript>window.open('tx.aspx','window','dialogWidth=565px;dialogHeight=410px');</script>");
}
在加载后无任何反应啊··
加载页是在iframe中显示··而弹出页不在iframe显示!
能把ClientScript.RegisterStartupScript的语法告示我吗··
大概这样的语法,应该有代码提示的
另外不要写在unload中,试试写在你的登录事件的最后
{
ClientScript.RegisterStartupScript(this.GetType(), "window", "window.open('tx.aspx','window','Width=565px;Height=410px');", true); }
还是没反应!郁闷啊·
调试里
<script language=javascript>window.showModalDialog('tx.aspx','window','dialogWidth=565px;dialogHeight=410px'); <
这是怎么回事啊·[[/code]
代码·Page.ClientScript.RegisterStartupScript(Page.GetType(), "clientScript", " <script language=javascript>window.showModalDialog('tx.aspx','window','dialogWidth=565px;dialogHeight=410px'); </script>");
调试里
<script language=javascript>window.showModalDialog('tx.aspx','window','dialogWidth=565px;dialogHeight=410px'); <
这是怎么回事啊·
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ ClientScript.RegisterStartupScript(this.GetType(), "window", "window.open('default.htm','window','Width=565px;Height=410px');", true); }
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index_main.aspx.cs" Inherits="JadeerpWeb.Login.index_main" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>内页</title>
<link href="~/Css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function selectspxx()
{
window.showModalDialog('tx.aspx','window','dialogWidth=565px;dialogHeight=410px');
}
</script>
</head>
<body>
<div style="width: 389px; position: absolute; top: 75px; left: 288px;">
<img src="../images/5.jpg"
style="width: 341px; height: 318px; margin-right: 0px" /></div>
<p>
</p>
<p>
</p>
</body>
</html>
public static void OpenWebForm1(string url,string width ,string height)
{
string js=@"<Scrip t language='JavaScrip t'>";
js += "window.open('"+ url + @"','','height = ";
js += height + ",width = " + width + ",top=100,left=100,location=no,menubar=no,resizable=no,scrollbars=no,status=yes,titlebar=no,toolbar=no,directories=no');";
js += "</Script>";
HttpContext.Current.Response.Write(js);
}