3

It seems to be impossible/hard to share views between several asp.net mvc 3 projects. At least, that's what Google tells me. Please correct me if I am wrong ...

What's about css and js files? Did someone do this already? If so, what is the best practice to achieve this (within a vs studio 2010 solution with several asp.net mvc 3 projects)?

Just curious, is it possible to share css and js between mvc3 areas?

3
  • You could branch/clone from your main version control system repository. Commented Mar 19, 2013 at 17:51
  • I use svn. not sure how this would work if the whole solution is in the same repository ... Commented Mar 19, 2013 at 17:53
  • Just learning a bit about areas (see for example:iwantmymvc.com/2011-02-15-mvc-3-areas-and-shared-layouts-part-2) How about areas? Commented Mar 25, 2013 at 8:32

2 Answers 2

1

Since you mention svn - it has "svn:externals" property that lets you map a folder (even from a different repository) to a location under the web site root folder. We used it with success to reuse multiple library tools with external resources (scripts, css files, images and views) in a number of MVC applications.

Sign up to request clarification or add additional context in comments.

3 Comments

could you please provide some more details?
Not really - that's why I asked for more information. To be honest, I am more looking into a portable area solution right now. Not sure whether this will work though so I keep my options open. Thanks anyway.
I don't understand your last comment. This is about svn:externals - svnbook.red-bean.com/en/1.0/ch07s03.html . When you have more specific questions - you are welcome to ask.
1

There is a cool way to share js, cshtml, css etc. files using "Add as Link" feature of VS. There is a great answer here describing the whole process. Also dont forget to add a build task to copy the files on build so you'd be able to debug them.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.