This is a migrated thread and some comments may be shown as answers.

[Solved] Problem with ScriptRegistrar

0 Answers 184 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Augeneer
Top achievements
Rank 1
Augeneer asked on 15 Apr 2011, 05:03 AM
I am having a odd problem with the MVC ScriptRegistrar.
When it gets called at the bottom of the following code block, an error occurs:

[Specified file does not exist: "~/Scripts/telerik.common.js"]

As you can see from the attached screen shot, the js are not in that directory but in "~/Scripts/2011.1.323/telerik.common.js"
If I try to set the default location of the scripts to the sub-folder, then other scripts files will not be found.
This was working up until I moved PC's...
Is there any way of fixing this without having all script files in a single folder?
   
@*Javascript at the bottom for fast page loading -->
     Grab Google CDN's jQuery. fall back to local if necessary*@
   <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
   <script>        !window.jQuery && document.write(unescape('%3Cscript src="@Html.ScriptPath("jquery-1.4.2.js")"%3E%3C/script%3E'))</script>
   @*use SquishIt to combine and compress all Javascripts for better performance*@
   @MvcHtmlString.Create(SquishIt.Framework.Bundle.JavaScript()
       .Add(HtmlHelpers.VirtualScriptPath("jquery-1.4.4.min.js"))
       .Add(HtmlHelpers.VirtualScriptPath("jquery.unobtrusive-ajax.min.js"))
       .Add(HtmlHelpers.VirtualScriptPath("jquery.validate.min.js"))
       .Add(HtmlHelpers.VirtualScriptPath("jquery.validate.unobtrusive.min.js"))
       .Add(HtmlHelpers.VirtualScriptPath("jquery-ui.min.js"))
       .Add(HtmlHelpers.VirtualScriptPath("jquery.ajaxui.js"))
       .Add(HtmlHelpers.VirtualScriptPath("json2.min.js"))
       .Add(HtmlHelpers.VirtualScriptPath("site.js"))
       //.ForceRelease() //comment in to enable compression.
       .Render(HtmlHelpers.VirtualScriptPath("combined_#.js"))
   )   
 
      @(Html.Telerik().ScriptRegistrar())
 
   <!--[if lt IE 7 ]>
   @Html.Script("dd_belatedpng.js")
   <script src="js/libs/dd_belatedpng.js"></script>
   <script> DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images </script>
   <![endif]-->

your ideas and help are appreciated in advance

regards
Augeneer
Tags
General Discussions
Asked by
Augeneer
Top achievements
Rank 1
Share this question
or