asp.net - 是否有像 contentplaceholder 这样的控件在 asp.net 中用于纯 html

标签 asp.net html xhtml dhtml

我有 HTML 页面,例如 example1.html、example2.html、example3.html 和 example4.html。所有页面都有相同的页眉、页脚和侧边栏。

我怎样才能制作一个复制其中任何一个的主模板,从而避免在每个 HTML 页面中重复页眉和页脚代码?

我的服务器端将是用 c# 编码的 asmx 网络服务。

最佳答案

您需要在 ASP.NET WebForms 或 ASP.NET MVC 中使用 MasterPages。在母版页系统中,您的公共(public)标记进入单个页面(您的母版页),然后 ContentPages 包含填充空白的独特内容。

关于asp.net - 是否有像 contentplaceholder 这样的控件在 asp.net 中用于纯 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3809826/

相关文章:

javascript - 从选择下拉列表中显示/隐藏 DIV

javascript - JavaScript 字符串中的双引号

html - 使 TextArea 填充屏幕顶部,IFrame 填充底部

javascript - 这种调整谷歌浏览器新标签使用的图像比例的技术是什么?

css - 无序包装 CSS 列表布局问题

c# - 用户控件内的 asp.net 更新面板不起作用

asp.net 编译错误 (mysql.data)

jquery - 如何在 IE7 中将 <li> 的宽度拉伸(stretch)到父 <ul> 中的可用空间?

c# - 如何在gridview中显示计算值?

asp.net - Javascript 在 MasterPage 中访问控制