你有沒有嘗試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>