xspydr
xspydr

Reputation: 3050

ASP.Net Share Master Pages, Js, Css across multiple applications

Okay, so I have a couple of ASP.Net Mvc web applications that I would like to share a common master page, some css and js files across...

I tried creating a common repository for the files and then in my studio projects using the Add Existing... As Link... feature but, this doesn't appear to work...

When I try and debug the project I get an error stating the master page cannot be found. Which is because it doesn't physically exist in the location where I created the link...

Has anyone gotten this to work or perhaps have another suggestion on how to share these types of common files...

Thanks..!

Upvotes: 1

Views: 1079

Answers (3)

BC.
BC.

Reputation: 24908

If you're using a source control system like SVN, you could keep your master page in one repository and reference that repository with a svn:externals property in your project repositories.

You could then branch the master page if each project required a modification that the other did not, while still maintaining the ability to merge changes made in the original.

Upvotes: 1

Hannoun Yassir
Hannoun Yassir

Reputation: 21182

i don't think it is a good idea because if you have a source control you might need to check in the application source code (including css and js files and masterpages) so someone else on an other machine can run (modify or update) it without problems

Upvotes: 0

Robert Koritnik
Robert Koritnik

Reputation: 105019

You won't be able to share master pages, but it's possible to share static resources like CSS files and Javascripts, but you wouldn't add them to your web application. You'd just reference them in your aspx files and provide their URL.

Where do these files reside? anywhere on the disc or in a folder of some other application?

Upvotes: 0

Related Questions