Naeem Naeem - 1 month ago 4x
HTML Question

I want when i click on <a href="whatever.aspx"></a> show the page inside the same page

That is my code:

<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" />

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

I want when i click on the a-tag the page dispaly in the iframe-tage .
I have an idea that use (onclick) with a-tag but i do not know how can i do it.
If there another way please tell me.


You can use the target attribute of the a-tag and give the name of the iframe as the target. This will load the page in the href to the iframe when you click on the link. eg.

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