【问题标题】:Open a page in Iframe from code behind Asp.net从 Asp.net 后面的代码在 Iframe 中打开一个页面
【发布时间】:2015-02-07 17:20:13
【问题描述】:

我试图从后面的代码中打开 Iframe 中的页面。我添加了这样的 LinkBut​​ton

<asp:LinkButton ID="lbEditProject" runat="server" Text="Project Details (edit)" OnClick="lbEditProject_Click"></asp:LinkButton>

当引发 OnClick 事件时,我想打开作为 html 页面的项目编辑页面,但我希望它出现在 iframe 中。我该怎么做?

【问题讨论】:

    标签: c# html asp.net iframe


    【解决方案1】:

    像这样将 iframe 添加到您的 html 中:

    <iframe sr="about:blank" id="myIFrame" runat="server" />
    

    在您的 onclick 事件中:

    myIFrame.src = "myeditpage.html"
    

    【讨论】:

      猜你喜欢
      • 2015-04-08
      • 2014-02-16
      • 2013-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多