4

I have strange problem. I downloaded theme. And i entered theme's main folder and opened index html in browser. Everything okey and looks well. Css and javascript loaded correct. Then i copy theme's folder into the my asp.net mvc project (with all folder(inlude css and js folder)). But when i opened index.html with my browser css and javascript not loaded correctly. I dont know why.

My themes folder structure is shown below:

enter image description here

My themes folder structure in my asp.net mvc project is shown below:

enter image description here

My html code:

<link rel="stylesheet/less" type="text/css" href="themes/less/bootstrap.less">
<script src="themes/js/less/less.js" type="text/javascript"></script>
<script src="themes/js/lib/jquery-1.9.1.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>

Also i tried(~/):

<link rel="stylesheet/less" type="text/css" href="~/themes/less/bootstrap.less">
<script src="~/themes/js/less/less.js" type="text/javascript"></script>
<script src="~/themes/js/lib/jquery-1.9.1.min.js"></script>
<script src="~/bootstrap/js/bootstrap.min.js"></script>

And exception:

enter image description here

Not: It is not working when in asp.net mvc project otherwise it is working.

5
  • 1
    Mayme less.js have to be loaded before .less theme file.
    – Daniele
    Aug 3, 2013 at 19:43
  • I loaded less.js before .less theme file and error has gone. But my index.html page not look well. Looks like not recognized css . But there is no error. Aug 3, 2013 at 19:45
  • 1
    Take a look at this answer
    – Daniele
    Aug 3, 2013 at 19:48
  • Thanks daniele i added this in my web config and problem resolved: <system.webServer> <staticContent> <mimeMap fileExtension=".less" mimeType="text/css" /> </staticContent > </system.webServer> Aug 3, 2013 at 19:54
  • @fuat You should make your comment that answer
    – user1752532
    Aug 10, 2013 at 14:33

1 Answer 1

3

Thanks daniele i added this in my web config and problem resolved:

<system.webServer> 
 <staticContent> 
  <mimeMap fileExtension=".less" mimeType="text/css" />    
 </staticContent > 
</system.webServer>

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.