2016-09-21 54 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米

相关问题