Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 类似于asp.net母版页的客户端解决方案_Javascript_Html_Asp.net Mvc - Fatal编程技术网

Javascript 类似于asp.net母版页的客户端解决方案

Javascript 类似于asp.net母版页的客户端解决方案,javascript,html,asp.net-mvc,Javascript,Html,Asp.net Mvc,我最近开始使用WebStorm来实现web应用程序,并发现这种体验比使用VisualStudio要好得多 我正在考虑将mvc中的“视图”部分尽可能多地转移到纯html,而不依赖服务器模板引擎,如Razor。因此,在需要服务器端代码之前,我不必打开VisualStudio 谷歌的结果显示,客户端模板引擎,如把手和胡子,将能够帮助生成动态html页面。有一件事我没有发现,就是能够将页面的“部分”组合在一起(如asp.net中的母版页),这样我们就不需要到处复制/粘贴页眉/页脚 如何使用客户端(即ja

我最近开始使用WebStorm来实现web应用程序,并发现这种体验比使用VisualStudio要好得多

我正在考虑将mvc中的“视图”部分尽可能多地转移到纯html,而不依赖服务器模板引擎,如Razor。因此,在需要服务器端代码之前,我不必打开VisualStudio

谷歌的结果显示,客户端模板引擎,如把手和胡子,将能够帮助生成动态html页面。有一件事我没有发现,就是能够将页面的“部分”组合在一起(如asp.net中的母版页),这样我们就不需要到处复制/粘贴页眉/页脚

如何使用客户端(即javascript)解决方案实现类似“母版页”的功能

谢谢您的帮助。

您可以尝试以下方法: 使用“shtml”文件构造网页,以便您可以参考包含说明:

<!--#include file="head.html"--><hr><b>Hello,this is body!</b><hr><!--#include file="foot.html"-->
你好,我是body
至于'head.html'和'foot.html',你知道它们应该包含什么。实际上,它们是'div'段~~~