简体   繁体   English

如何在同一解决方案中跨项目共享css和js文件?

[英]How to share css and js files across projects in the same solution?

How to share css, js and aspx fils across the projects? 如何在项目中共享CSS,JS和ASPX FIL? I ahve to keep all the common files in one project and refer these in other projects in the same solution. 我将所有通用文件都保存在一个项目中,并在同一解决方案中将其引用到其他项目中。 Please let me know how I can share the files across the projects in the same solution? 请让我知道如何在同一解决方案中跨项目共享文件?

Have one common project, call it something like Shared or Utilities (make sure it's a web project). 有一个公共项目,将其称为“共享”或“实用程序”(确保它是一个网络项目)。 Put your files in that project, then use the URL of that project + the path to the file to reference them in your other projects, something like: 将文件放在该项目中,然后使用该项目的URL +文件路径在其他项目中引用它们,例如:

http://mysharedproject.co.uk/content/site.css http://mysharedproject.co.uk/content/site.css

I think you could use ASP.Net MVC Portable Areas for that. 我认为您可以为此使用ASP.Net MVC可移植区域 With portable areas you can embed scripts and css in your DLL files and reuse them across applications. 使用可移植区域,您可以将脚本和CSS嵌入DLL文件中,并在应用程序中重复使用它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM