導航遠離使用iframe引用的頁面

[英]Navigating away from page referenced using iframe


What I have at the moment is a page which I am using as a sirt of site master for my html pages. The way I am doing this is by referencing the master page using this line of code:

我目前所擁有的是一個頁面,我正在使用它作為我的html頁面的站點主人的sirt。我這樣做的方法是使用以下代碼行引用母版頁:

<iframe scrolling="no" style="width:100%;" frameBorder="0" src="WebForm1.aspx"></iframe>

Now that works fine, I can create a new page and reference that, and then the content from that page will appear on any page referencing it.

現在工作正常,我可以創建一個新頁面和引用,然后該頁面中的內容將出現在任何引用它的頁面上。

But I have a problem, what I want Is if you click the navigation button that is in header of a page that is referencing this site master; it navigates away but only the iframe will hold the webpage, and the main content will still be the same.

但我有一個問題,我想要的是如果你點擊引用這個站點主頁的頁面標題中的導航按鈕;它導航離開,但只有iframe將保留網頁,主要內容仍然是相同的。

For example:

例如:

In the master page I am referencing using the Iframe, I have some code that when you click on a button it navigates away, ok. But if I go into a page that is referencing the master and click the button, the new web page will only open in the iframe section at the top of the page.

在我使用Iframe引用的母版頁中,我有一些代碼,當您單擊按鈕時,它會導航,好的。但是,如果我進入引用主頁並單擊按鈕的頁面,則新頁面將僅在頁面頂部的iframe部分中打開。

Sorry for this complicated question, if anyone understands it, then any advice would be helpful!

對於這個復雜的問題感到抱歉,如果有人理解,那么任何建議都會有所幫助!

The page that is referencing the master:

引用主服務器的頁面:

http://codepad.org/IyrDxAf9

http://codepad.org/IyrDxAf9

The master page itself:

母版頁本身:

http://codepad.org/XMu67H1M

http://codepad.org/XMu67H1M

PS...I am coding this in asp.net using html

PS ...我正在使用html在asp.net中編碼

The aim of all this is to create a master page for html, but I am not having much luck with it

所有這一切的目的是為html創建一個母版頁,但我沒有太多運氣

1 个解决方案

#1


1  

You can set the following in your webform1.aspx page:

您可以在webform1.aspx頁面中設置以下內容:

<base target="_parent" />

This will target all the links on that page to the 'parent' window. You can also do this with individual links.

這會將該頁面上的所有鏈接定位到“父”窗口。您也可以使用單個鏈接執行此操作。

Seeing as you are using .aspx pages here, is there a reason why you are not using the built in master page functionality?

看到你在這里使用.aspx頁面,是不是有理由不使用內置母版頁功能?


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2013/04/21/7210d3a7d91df97564eb6c354cd7573c.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com