Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Javascript and Css files in Episerver

Vote:
 

Hello

Can i place all the javascript and css files in file server in EPiServer CMS? If so how can i give the path for src attribute if i want to refer to file manager for Javascripts and CSS?

Thanks

Rachappa

#40943
Jun 23, 2010 18:42
Vote:
 

There are no problems store all your css and JS files in your solution. (it could a problem NOT to have css... ;-) ) Just create folders for your content, put your files in there and reference them from your code. All references are standard .Net with / beeing your site root...  You can also use ResolveUrl method in System.Web.UI.Control to get your file paths. Eg. <script type="text/javascript" src="<%=ResolveUrl("~/Scripts/js/jquery-1.3.2.min.js")%>"></script>

If your question is if it is possible to place your css and js files in the %programfiles%\EPiServer\CMS\X.X.X.X\application folders, the answer is yes, but I'm guesssing it is not a recommended solution. You can create virtual paths for a folder and share that folder between several solutions. (if you have more than one solution using the same js or css files....)

#40950
Jun 24, 2010 8:01
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.