0
可以接收來自 的IFrame後面的代碼(ID和點對多點)已發送的參數的JavaScript彈出,然後將其發送到頁面父在javascript中接收函數參數?
代碼的IFrame
protected void btnConfirm_Click(object sender, EventArgs e)
{
EDPBLL = new EDPLogic();
int id = EDPBLL.Add(Convert.ToInt32(Request.QueryString["EDP"]), Convert.ToInt32(Session["userId"]), DateTime.Now, Convert.ToInt32(ddlPrensa.SelectedValue));
string numeroEDP = EDPBLL.generarNumeroEDP(id);
EDPBLL.UpdateEdpCode(id, numeroEDP);
Session["pEDPId"] = id;
Session["numeroEDP"] = numeroEDP;
int pTmp = 4;
ScriptManager.RegisterStartupScript(Page, GetType(), "Popup", "<script>Popup('"+id+"','"+pTmp+"')</script>", false);
}
的腳本模擬點擊事件父窗口的
編寫JavaScript代碼的.aspx
<script type="text/javascript">
function Popup() {
$("#MainContent_btnPrueba", window.parent.document).trigger("click");
}
</script>
請使用您需要的iframe以最簡單的形式隔離您的代碼。我們不一定需要查看特定於應用程序的代碼,只是一個簡單的孤立示例,顯示您正在嘗試完成的任務。 – istos 2014-11-01 03:57:24