如何存储一个ASP.NET母版页在一个共同的图书馆吗? [英] How to store an ASP.NET master page in a common library?

查看:141
本文介绍了如何存储一个ASP.NET母版页在一个共同的图书馆吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望有它们使用相同的母版页几个内部Web应用程序。是否有一个母版页存储在所有项目中引用的公共库的方式?

We would like to have several internal web applications which use the same master page. Is there a way to store a master page in a common library referenced by all projects?

推荐答案

您可以做到这一点,但这是困难的,有不少缺点。

You can do this, but it is difficult and has quite a few drawbacks.

此过程类似于包装起来的用户控件以及。基本上你拥有一个包含母版页Web应用程序项目。您可以precompile此为一组使用aspnet_compiler的DLL。

This process is similar to packaging up user controls as well. Basically you have a web application project that contains your master page. You can precompile this into a set of dlls using aspnet_compiler.

然后就可以使用ilmerge.exe把他们都变成一个DLL,你再从其他项目中引用。

then you can use ilmerge.exe to put them all into a single dll that you then reference from your other projects.

您仍然需要有才能的标记为您的网页正确呈现在设计,所以你可能要调查VirtualPathProviders为好。

You still need to have the markup in order for your pages to render properly in the designer, so you'll probably have to investigate VirtualPathProviders as well.

这是一个缺憾解决方案,它有很多缺点。

It's a kludgy solution and it has many drawbacks.

这篇关于如何存储一个ASP.NET母版页在一个共同的图书馆吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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