2016-09-21 96 views
0

這是我的代碼裏面:我希望當我在<a href="whatever.aspx"></a>點擊顯示在頁面的同一頁

<asp:DataList ID="dlGallery" runat="server" RepeatLayout="Flow" Width="100%" CellPadding="4" ForeColor="#333333"> 

    <AlternatingItemStyle BackColor="White" ForeColor="#284775" /> 
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> 
    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> 
    <ItemStyle BackColor="#F7F6F3" ForeColor="#333333" /> 

    <ItemTemplate>      
    <table border="1"> 
     <tr> 
     <td> 
      <a href="Album.aspx?GalleryId=<%#Eval("GalleryId") %>"> 
      <%# Eval("GalleryName") %> 
       </a> 
      </td> 
     <td> 
      <%# Eval("GalleryDescription") %> 
      </td> 
     </tr> 
    </table> 
    </ItemTemplate> 
    <SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> 
</asp:DataList> 

我希望當我在一個標籤點擊iframe的塔格頁面dispaly。 我有一個想法,使用(onclick)與標籤,但我不知道我該怎麼做。 如果還有其他方法,請告訴我。

+0

http://stackoverflow.com/questions/740816/open-link- in-iframe –

+0

這是工作。感謝 – Naeem

回答

0

您可以使用a-tag的target屬性並將iframe的名稱作爲目標。當你點擊鏈接時,這會將href中的頁面加載到iframe中。 例如。

<!DOCTYPE html> 
<html> 
<head> 
<title></title> 
</head> 
<body> 
<iframe name="nn" src=""></iframe> 
<a href="test.html" target="nn">link</a> 
</body> 
</html> 
0

「目標=」 iframe1" >

即答案感謝@ freedomn米

相關問題