【问题标题】:Displaying DIV from another ASPX page?从另一个 ASPX 页面显示 DIV?
【发布时间】:2013-01-07 13:45:11
【问题描述】:

我正在开发一个地图应用程序 (VS2008 C#),并在我的主 aspx 中显示我的地图窗口 (Esri ADF MapControl)。

我现在正在编译一个带有另一个 aspx 页面的打印模板,该页面将显示和打印来自主 aspx 的当前地图。

通常我会使用 Frame 标签来显示打印模板中的主 aspx,但我只是对复制地图 DIV 感兴趣。

【问题讨论】:

    标签: c# html gis


    【解决方案1】:

    您可以尝试使用 jquery:

    <!DOCTYPE html>
    <html>
    <head>
        <style>
     body{ font-size: 12px; font-family: Arial; }
     </style>
        <script src="http://code.jquery.com/jquery-latest.js"></script>
    </head>
    <body>
    
    <b>Footer navigation:</b>
    <div id="mydiv"></div>
    
    <script>
      $("#mydiv").load("mypage.html");
    </script>
    
    </body>
    </html>
    

    来源:http://api.jquery.com/load/

    【讨论】:

    • 好的,谢谢。我可以在 ASPX 中指定要加载的 DIV 吗?例如...
    • 为什么不把你的aspx页面作为用户控件(.ascx)
    • 啊,真的吗?我正在尝试使用它,但页面加载为空白...
    • 我正在一个无法访问 Internet 的独立机器上开发 localhost,所以它可能无法识别 jquery 库脚本 URL?
    • 是的,当然,这个 url 是从 jquery 网站请求的 :)
    猜你喜欢
    • 2014-03-07
    • 2014-09-04
    • 2020-12-02
    • 1970-01-01
    • 2011-01-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多