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

[Solved] error on registering jquery.js via ScriptRegistrar

0 Answers 165 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.
mahmoud
Top achievements
Rank 1
mahmoud asked on 14 Oct 2011, 04:33 PM
Dear Teleriks , 
I have the following codes :
at <head> : 
@(
 Html.Telerik()
    .ScriptRegistrar()
    .DefaultGroup(o => o.Enabled(false))
    .Scripts(scripts =>
    {
        scripts.AddGroup("HeaderScript", group => group
            .Add("~/Scripts/jquery-1.5.1.min.js")
            .Add("~/Scripts/MicrosoftAjax.js")
	    .Add(...)
            .Combined(true)
            .Compress(true));
    }))

and at the bottom of the page : 
@(Html.Telerik()
    .ScriptRegistrar()
    .jQuery(false)
    .jQueryValidation(false)
    .Globalization(true)
    .DefaultGroup(group => group
        .Add("2011.2.725/telerik.window.js")
        .Add("2011.2.725/telerik.draganddrop.min.js")
        .Enabled(true)
        .Combined(true)
            .Compress(true))
)

but I got javascript error because of these two lines :
            .Add("~/Scripts/jquery-1.5.1.min.js")
            .Add("~/Scripts/MicrosoftAjax.js")


if I remove these two lines and add the following lines at the top of the page everything would be ok ;

<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MicrosoftAjax.js")" type="text/javascript"></script>

I want to know why I can't add these two files to web asset?

P.S. The errors depend on the page content but a sample is: 
  1. Uncaught TypeError: Object [object Object] has no method 'tDropDownList'
  1. asset.axd:1025Uncaught Sys.ArgumentTypeException: Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'. Parameter name: instance
  1. asset.axd:16Uncaught TypeError: Object [object Object] has no method 'tDropDownList'
  1. asset.axd:1025Uncaught Sys.ArgumentTypeException: Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'. Parameter name: instance
  1. asset.axd:16Uncaught TypeError: Object [object Object] has no method 'tDropDownList'
2
  1. asset.axd:1025Uncaught Sys.ArgumentTypeException: Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'. Parameter name: instance

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