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

jQuery Path

2 Answers 104 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.
Sean
Top achievements
Rank 2
Sean asked on 24 Feb 2010, 06:54 PM
I have the following:

 <%
        Html.Telerik().ScriptRegistrar()
            .DefaultGroup(group => group
                                       .Add("~/Scripts/jquery.1.4.1.min.js")
                                       .Add("~/Scripts/MicrosoftAjax.js")
                                       .Add("MicrosoftMvcAjax.js")
                                       .Add("transact.js")
                                       .Combined(true)
                                       .Compress(true))
                                       .Render();
    %>

My javascript is in the Scripts folder. All of the jQuery files are there, including the vsdocs and minified.

I get the following error:

Server Error in '/' Application.

Specified file does not exist: "~/Scripts/jquery-1.4.js".

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Specified file does not exist: "~/Scripts/jquery-1.4.js".

Source Error: 

Line 77:     </form>Line 78:     <%Line 79:         Html.Telerik().ScriptRegistrar()



I am unsure of why this is happening. Nowhere do I have a file called jquery-1.4.js.

Thoughts?

Sean~

2 Answers, 1 is accepted

Sort by
0
Sean
Top achievements
Rank 2
answered on 24 Feb 2010, 06:59 PM
Correction to my code:

<%
        Html.Telerik().ScriptRegistrar()
            .DefaultGroup(group => group
                                       .Add("jquery.1.4.1.min.js")
                                       .Add("MicrosoftAjax.js")
                                       .Add("MicrosoftMvcAjax.js")
                                       .Add("transact.js")
                                       .Combined(true)
                                       .Compress(true))
                                       .Render();
    %>
0
Kelly Stuard
Top achievements
Rank 1
answered on 02 Mar 2010, 05:57 PM
Given that you are explicitly including jQuery, you should be doing:

 

<%  
  Html.Telerik().ScriptRegistrar().jQuery(false)  
    .DefaultGroup(group => group  
      .Add("jquery.1.4.1.min.js")  
      .Add("MicrosoftAjax.js")  
      .Add("MicrosoftMvcAjax.js")  
      .Add("transact.js")  
      .Combined(true)  
      .Compress(true))  
      .Render();  
%> 

 


Notice the addition of ".jQuery(false)" in the chain? This tells Telerik not to try to find it on its own. This was why you were getting the error of it looking for version '1.4', instead of the '1.4.1' that you are including manually.

 

Tags
General Discussions
Asked by
Sean
Top achievements
Rank 2
Answers by
Sean
Top achievements
Rank 2
Kelly Stuard
Top achievements
Rank 1
Share this question
or