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

RadScriptManager Documentation

15 Answers 925 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shaun Peet
Top achievements
Rank 2
Shaun Peet asked on 19 Dec 2007, 12:03 AM
I'm highly interested in the potential benefits that the RadScriptManager is supposed to be providing, but so far it appears that something isn't working just yet.  Having no documentation isn't helping me out either.  I've replaced my ScriptManager with the RadScriptManager, added the HttpHandler to the web.config, and run the project, and come across the following javascript error:

"... type Telerik.Web.BoxSlide has already been added ..."

The situation is that I've got a Prometheus menu on the main page, which loads a User Control upon the Page_Load that also contains another menu and it appears that the RadScriptManager tries to load the necessary types twice because of that.

I could be way off... but again, without any documentation it's hard to figure out what's going on.

15 Answers, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 19 Dec 2007, 05:06 AM
Shaun-

I haven't tested that exact scenario yet, but it sounds plausible that the problem is related to the way the UserControl is being loaded. Clearly, the scenario should be supported, so perhaps you can prepare a sample project and attach it to a support ticket for our devs to evaluate.

I will work on building a demo locally and see if I can reproduce the behavior. Expect our devs to take a look at this in a few hours, too.

-Todd
0
Erjan Gavalji
Telerik team
answered on 19 Dec 2007, 12:37 PM
Hi guys,

I just created a page trying to reproduce the problem Shaun is having. I added five scenarios there:
  • RadMenu placed directly to the page;
  • RadMenu placed in a user control, which instance is placed directly to the page;
  • The user control loaded on Page_Load;
  • The user control loaded on button postback;
  • The user control loaded via an AjaxCall on a button click;
To my regret I was not able to locate the double script rendering.

Shaun, can you please, help me reproduce the problem?

I'm sorry for the problem you've had with the documentation - we are now working on solving it and we will upload it later today or early tomorrow.

As a preliminar information - basically the usage of RadScriptManager does not have any differences than the usage of the ScriptManager, so you should not face a problem using it as far as you have the HttpHandler declared in the web.config file.

To help us find the problem faster you can try disabling the script merge by setting the EnableScriptCombine to false and check if this will temporarily elliminate the problem.

I'm looking forward to your reply.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shaun Peet
Top achievements
Rank 2
answered on 19 Dec 2007, 03:14 PM
Test
0
Shaun Peet
Top achievements
Rank 2
answered on 19 Dec 2007, 03:18 PM
Sorry about the test post.  I had replied a minute ago and the site crashed!

Anyways...

I set EnableCombineScripts="false" and that no longer produces the javascript error.

Also, when the radscriptmanager is combining scripts I should mention that the entire page appears to be working correctly - the menus slide, the ajax works, etc.  It just has the javascript error upon page load.

Here's the code where it fails (from the VS script debugger):

Type.prototype.registerEnum = function Type$registerEnum(name, flags) {
/// <summary locid="M:J#Sys.UI.LineType.#ctor" />
/// <param name="name" type="String"></param>
/// <param name="flags" type="Boolean" optional="true"></param>
var e = Function._validateParams(arguments, [
{name: "name", type: String},
{name: "flags", type: Boolean, optional: true}
]);
if (e) throw e;
if (!Type.__fullyQualifiedIdentifierRegExp.test(name)) throw Error.argument('name', Sys.Res.notATypeName);
// Check if the type name parses to an existing object that matches this.
var parsedName;
try {
parsedName = eval(name);
}
catch(e) {
throw Error.argument('name', Sys.Res.argumentTypeName);
}
if (parsedName !== this) throw Error.argument('name', Sys.Res.badTypeName);
if (Sys.__registeredTypes[name]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, name));
for (var i in this.prototype) {
var val = this.prototype[i];
if (!Type.__identifierRegExp.test(i)) throw Error.invalidOperation(String.format(Sys.Res.enumInvalidValueName, i));
if (typeof(val) !== 'number' || (val % 1) !== 0) throw Error.invalidOperation(Sys.Res.enumValueNotInteger);
if (typeof(this[i]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.enumReservedName, i));
}
Sys.__upperCaseTypes[name.toUpperCase()] = this;

for (var i in this.prototype) {
this[i] = this.prototype[i];
}
this.__typeName = name;
this.parse = Sys$Enum$parse;
this.__string = this.toString();
this.toString = Sys$Enum$toString;
this.__flags = flags;
this.__enum = true;
Sys.__registeredTypes[name] = true;
}


I will have a look at the sample project and see where the differences are.

Hope that helps,

Shaun.
0
Erjan Gavalji
Telerik team
answered on 19 Dec 2007, 03:41 PM
Hi Shaun,

Indeed, this is the typical location of the js exception when a script is included twice to the page. We should find why does it get included twice to the page.

Here are some reasons I guess:
- ScriptReferences declared to the RadScriptManager;
- the page includes a <script> tag to some of the Telerik.Web.UI scripts;

Can you please, check your page for any of these?

Looking forward to hearing from you,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Erjan Gavalji
Telerik team
answered on 19 Dec 2007, 04:06 PM
Hi Shaun,

I just wanted to add that our documentation is already updated. If you refresh the both the frames by using CTRL+F5 you should be able to access the new content.

Best,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shaun Peet
Top achievements
Rank 2
answered on 19 Dec 2007, 05:57 PM
Thanks for the update in the documentation (particularly the TreeView docs).

Can you elaborate on what you mean by this:
Here are some reasons I guess:
- ScriptReferences declared to the RadScriptManager;
- the page includes a <script> tag to some of the Telerik.Web.UI scripts;

As far as I know, I'm not doing either of those because I'm not quite sure how I'd going about doing either one ;)

Shaun.

0
Erjan Gavalji
Telerik team
answered on 20 Dec 2007, 08:18 AM
Hi Shaun,

What I meant with those statements was that for different reasons some customers prefer including the javascript files manually to the page and I though your page might do that too. As you say your page doesn't do any of them, the reason for the error becomes really strange. Can you elaborate a bit by copying the page to a separate web application and sending it to us?

We will check if we too get the error and will do our best to fix it for the service pack.

Thanks for your help so far.

Cheers,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
lchesnais
Top achievements
Rank 1
answered on 02 Jan 2008, 03:51 PM
Hello,

I ran into the very same issue: Firebug console reports that "... type Telerik.Web.BoxSlide has already been added ..."

I managed to create a sample web site that reproduce the issue.
My sample is using user control within a RadDock.

If the user control is located in the same directory as my page I don't have the issue.
If the user control is located in a subdirectory (I did not test other directories) the issue arise. The reason being that RadScriptManager generates two javascript references:
<script type="text/javascript" src="Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RSM_HiddenField&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2007.3.1218.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3afr-FR%3a9227e52a-3049-472d-b071-1e8ba885fccc%3adf096e91%3ac83cd1a%3aec9d8673%3a3b7b9a3b%3a85059e87%3a6d769fc0%3a251a9451%3a81330300%3ac6335cbd%3a34f9d57d">  
</script> 
<script type="text/javascript" src="UC/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RSM_HiddenField&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2007.3.1218.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3afr-FR%3a9227e52a-3049-472d-b071-1e8ba885fccc%3adf096e91%3ac83cd1a%3aec9d8673%3a3b7b9a3b%3a85059e87%3a6d769fc0%3a251a9451%3a81330300%3ac6335cbd%3a34f9d57d">  
</script> 
 
But these script files seems to be the very same (I did not check extensively).
Appart from the directory name (here UC), the src value seem to be identical.

BR, Laurent
0
lchesnais
Top achievements
Rank 1
answered on 02 Jan 2008, 09:04 PM
Hello,

I opened a support ticket (ID: 114663) with the sample code.

BR, Laurent
0
Erjan Gavalji
Telerik team
answered on 04 Jan 2008, 05:11 PM
Hi guys,

Laurent, thank you for the application. We were now able to reproduce the problem. It was indeed a bug on our side and we already fixed it.

Please, find attached the latest build of the control, where finally the problem is fixed.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Thomas
Top achievements
Rank 1
answered on 15 Jan 2008, 09:05 PM
I'm using 2007.3.1218.20 of the Prometheus components and I too am getting this same error (Sys.InvalidOperationException: Type Telerik.Web.BoxSide has already been registered.) when I set EnableScriptCombine on the RadScriptManager to true. In my case, I have the RadScriptManager on a master page. The child or derived page has a some standard .NET DropDownList and button controls and two Prometheus RadGrids.

I'm using VS 2005 and do have the Ajax Control Toolkit installed. I have also verified that the web.config contains all the handlers and .NET Ajax goo needed.
0
Sebastian
Telerik team
answered on 16 Jan 2008, 08:32 AM
Hello Thomas,

Can you please check whether the same problem occur when you migrate to the Q3 2007 SP1 release of RadControls Prometheus announced yesterday? If the issue is still there, the best means to progress in our investigation is to prepare a stripped working version of your project, reproducing the abnormality, and send it attached to a formal support ticket. We will test it locally and will get back to you with our findings.

Kind regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Riaan Gouws
Top achievements
Rank 1
answered on 16 Jan 2008, 09:23 AM
Can you please advise as to when an update for this will be available for the licensed version as it is only available for the trial version and using the hotfix (RadControls_Prometheus_2007_3_1218_dev_hotfix.zip) currently for version 2007_3_1218 does not work and still generates the same error discussed here in this thread.

I have in the meantime changed RadScriptManager to the default ScriptManager but would like to make full use of the Rad Controls in my application as it is a full system upgrade and the system will make use of just every control available in the suite.

Can you also advise as to when the RadPanelBar for Prometheus will be made available?
0
Steve
Telerik team
answered on 16 Jan 2008, 09:35 AM
Hello Edward,

As my colleague explained - please upgrade to the latest Q3 SP1 release which contains the fix for this problem as well. I've just checked your account and you have access to the dev version - please use your Client.NET account to download it and upgrade.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Shaun Peet
Top achievements
Rank 2
Answers by
Todd Anglin
Top achievements
Rank 2
Erjan Gavalji
Telerik team
Shaun Peet
Top achievements
Rank 2
lchesnais
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Sebastian
Telerik team
Riaan Gouws
Top achievements
Rank 1
Steve
Telerik team
Share this question
or