Jasmine
Jasmine

Reputation: 23

How can I share my stylesheets between different solutions in ASP.NET MVC 3?

I have three solutions; all share one thing in common which is the stylesheets. I would like to have only one version of the stylesheets.

I thought to put this and maybe other things like common scripts in one project and then have all three solutions reference this same project.

But how can I link in the stylesheets to my layout pages. Currently I use:

<link href="@Url.Content("~/Content/Stylesheets/Package3.css")" 
      rel="stylesheet" type="text/css" />

Any advice would be appreciated.

Upvotes: 2

Views: 818

Answers (2)

Nick Berardi
Nick Berardi

Reputation: 54854

You might be able to do this with your source control? But the better solution might ultimately be to make a 4th project of your static shared files (ex. css, javascript, images) and deploy them to a URL that you will only use to serve this content.

So you can reference in your project like:

<link href="http://mydomain.com/content/stylesheets/package3.css" rel=stylesheet" type="text/css" />

Where mydomain.com is actually your 4th project that only hosts the static content.

Upvotes: 1

Max Toro
Max Toro

Reputation: 28608

You can use the 'Add as link' option.

Upvotes: 0

Related Questions