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

ScriptRegistrar disable jquery reference

6 Answers 377 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.
Nabil Shuhaiber
Top achievements
Rank 1
Nabil Shuhaiber asked on 01 Sep 2009, 10:17 AM
 
I am using the scriptregistrar without jquery however it complains that it   
cannot find "jquery-1.3.2.js". I have manually commented out line 28 in   
ScriptRegistrar to get around this. Is there a dependency on jquery. If not is   
there any way to disable it from the api. 

Thanks  

6 Answers, 1 is accepted

Sort by
0
Accepted
Kazi Manzur Rashid
Telerik team
answered on 03 Sep 2009, 09:04 AM
Hello Nabil Shuhaiber,

Put the following line in the global.asax application_start:

ScriptRegistrar.FrameworkScriptFileNames.Clear();

I think it will not try to include the file agaian.

All the best,
Kazi Manzur Rashid
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Drew
Top achievements
Rank 1
answered on 03 Mar 2010, 08:42 PM
Im having this same problem, Only that suggested solution isnt working for me.

I have an mvc menu and grid on my site.   I have alot of jquery scripts filtering the grid which all work well,  once I introduce jQuery ui effects I get problems,  When I remove the script registrar, my ui effects work Obviously breaking my grid and menu.   Im already including my own reference to jQuery 1.3.2  is there any way to just remove this one script in my scriptregistrar?   when I load my page, I am seeing my jquery reference at the top of the page and the script registrar posts one at the bottom.

When both scripts are being registered, my grid and menu do work (Thankfully) but no matter what I do, I get weird errors on jquery ui as long as these scripts are coming up twice.

Is there any way I can force the telerik registrar to reference a blank file for jquery to alleviate this issue?
0
Drew
Top achievements
Rank 1
answered on 03 Mar 2010, 09:47 PM
In the meantime, Adding the jQuery ui script after the script registrar seems to be working for me, even with the double jquery reference.

running the effect function with a $(document).ready(function() { CODE HERE });
makes sure the page finishes loading and the ui reference works.

Im not sure this is how you would recommend doing it but just sharing the info for anyone else that may need it.
0
Atanas Korchev
Telerik team
answered on 04 Mar 2010, 08:10 AM
Hi Drew,

To make the ScriptRegistrar not include jQuery use the jQuery method:

<%= Html.Telerik().ScriptRegistrar().jQuery(false) %>

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Daniel Burton
Top achievements
Rank 1
answered on 29 Jun 2011, 12:50 PM
Hi,
This just gives a compilation error: "BC30451: 'Html' is not declared. It may be inaccessible due to its protection level."

What do you need to do to prevent this compilation error?

Thanks
0
Atanas Korchev
Telerik team
answered on 29 Jun 2011, 01:15 PM
Hello Daniel Burton,

This is very strange. Html should be available in all ASP.NET MVC view pages. Do other HTML extensions work as expected e.g. Html.TextBox?

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Nabil Shuhaiber
Top achievements
Rank 1
Answers by
Kazi Manzur Rashid
Telerik team
Drew
Top achievements
Rank 1
Atanas Korchev
Telerik team
Daniel Burton
Top achievements
Rank 1
Share this question
or