【问题标题】:I want when i click on <a href="whatever.aspx"></a> show the page inside the same page我想当我点击 <a href="whatever.aspx"></a> 时显示同一页面内的页面
【发布时间】:2017-01-29 20:04:07
【问题描述】:

这是我的代码:

<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-tage 中的页面显示时,我想要。 我有一个想法,将 (onclick) 与 a-tag 一起使用,但我不知道该怎么做。 如果有其他方法请告诉我。

【问题讨论】:

标签: javascript jquery html asp.net database


【解决方案1】:

您可以使用 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>

【讨论】:

    【解决方案2】:

    " target="iframe1">

    这就是答案谢谢@freedomn-m

    【讨论】:

      猜你喜欢
      • 2012-02-08
      • 1970-01-01
      • 1970-01-01
      • 2017-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多