2016-05-10 102 views
0

我的索引頁面中有一個iFrame。此iFrame包含一個帶有表單的aspx頁面,其中包含runat=serveriframe與aspx頁面使頁面停止呈現

由於一些奇怪的原因,我在iFrame之後添加的任何東西都沒有呈現給頁面。

我嘗試添加文本,一個div,當我運行頁面後沒有任何內容被添加。

代碼:

<body> 

     <asp:Panel ID="Panel1" runat="server" Height="80px"> 
     <iframe name="LogoFrame" id="LogoFrame" src="asp/Logo.aspx" 
      scrolling="no" 
      style="border-style: hidden; padding: 0px; margin: 00px; width: 100%; height: 100%" 
      width="100%"/> 
     </asp:Panel> 

     <form id="MainMenu" method="post" runat="server"> 

     <asp:Panel ID="Panel2" runat="server" Height="38px"> 

      <table class="tableMenu" id="MainTable" style="BACKGROUND-COLOR: #e2eded" cellSpacing="0" 
       cellPadding="0" width="100%" border="0"> 
       <tr class="trMenu2" vAlign="middle"> 

     // Some other things below, including the closing of Panel2 and MainMenu form 

當我運行和檢查網頁...

enter image description here

如果我刪除的iFrame,該頁面的其餘部分正確呈現。
這是怎麼回事?

回答

2

我懷疑這是因爲iframe標籤是自閉的,而iframe不應該是自閉的。如果您將'/>'替換爲'></iframe>',我認爲這應該可以解決問題。

+0

是的,我以前做過。我忘了回答我自己的問題,但既然你已經做到了,謝謝:) – Phiter

0

似乎iframe不在form標記之內。但是你把iframe放在一個面板裏面,這是一個asp.net工具。您可以嘗試移除面板,或移動表單標籤內的代碼。

+0

沒有任何選項可行。 – Phiter