如何在asp.net页面中包含外部html文件 [英] How to include an external html file in asp.net page

查看:184
本文介绍了如何在asp.net页面中包含外部html文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 asp.net 网页中包含外部html文件。在PHP中,我们可以使用 include 函数,如果asp.net有类似的功能,请告诉我。我的意图是,我有一个共同的头文件html文件,所以我需要将这个文件包含在所有 aspx 页面中。

How I can include an external html file in asp.net web page. In PHP we can use include function, if asp.net have any similar function, please let me know. My intention is, i have a common header html file, so I need to include that file in all aspx pages.

推荐答案

服务器端包含可在不同平台上使用,并且可用于包含静态内容。您可以在IIS中使用它们,但我需要在IIS7中启用它们。

Server side includes are available across different platforms and a useful for including static content. You can use them in IIS but I they need to be enabled in IIS7.

<!-- #include file="Static/Menu.html" -->

有关在IIS7中启用SSI的说明,请参阅 http://tech.mikeal.com/

Instructions to enable SSI in IIS7 are available at http://tech.mikeal.com/

对于动态内容,有一种名为MasterPages的内置模板方法,应该使用它。

For dynamic content, there is a built-in method of templating called MasterPages, this should be used instead.

这篇关于如何在asp.net页面中包含外部html文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆