你有没有尝试window.opener.location.href(在JavaScript中)?
您也可以在开头器中用javascript调用pageMethod以从您的(服务器端查询)取回CSS并将其应用到您的页面。
Link
Popup.aspx
<form id="form1" runat="server">
<asp:ScriptManager EnablePageMethods="true" runat="server"></asp:ScriptManager>
<div>
<script>
function call() {
var location = window.opener.location.href;
PageMethods.GetPhoneNumber(location, clientcall);
}
function clientcall(phone){
alert(phone);
}
</script>
<a href="javascript:call();">Call</a>
</div>
</form>
Popup.aspx.cs
使用系统; using System.Collections.Generic;使用System.Linq的 ; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Services;
public partial class Popup : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[WebMethod]
public static string GetPhoneNumber(string referer)
{
//把你的代码中调用此数据库 回报 “888-888-888”; }}
调用页面
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<script>
function opening() {
window.open("Popup.aspx","mywindow", "status=1,toolbar=1");
}
</script>
<a href="#" onclick="opening()">Ouvrir</a>
</body>
</html>