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

AJAX in a SharePoint WebPart

4 Answers 81 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eraph
Top achievements
Rank 1
Eraph asked on 10 Sep 2010, 01:26 PM
I'm developing a WebPart for use in WSS3 that uses the RadTicker control. I have followed the instructions here that demonstrate how to enable AJAX in WebParts, but there appears to be something missing. Hovering over the navigation buttons at the top of the screen on SharePoint does not trigger the 'mouseover' event, so they do not change appearance, and instead a javascript error is revealed. I looked deeper and found that when the WebPart is shown on a page, a reference to "WebResource.asx" is no longer present - this contains the 'mouseover' code, and perhaps other SharePoint javascripty stuff.
Anyway, I found the culprit piece of code to be this:

ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
if (scriptManager == null)
{
    scriptManager = new RadScriptManager();
    this.Page.Form.Controls.AddAt(0, scriptManager);
}

Removing this stops the error in SharePoint, but of course it gooses the operation of the WebPart. It looks as though the scriptmanager is overriding SharePoint's own scriptmanager (although when I check the current scriptmanager while stepping through code, it is empty). Any ideas what could be causing this problem?

4 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 15 Sep 2010, 03:47 PM
Hi Phil,


Thank you for the detailed problem description.

Please try replacing the RadScriptManager with the standard ScriptManager. Does this help?

Sincerely yours,
Tsvetomir Tsonev
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
Eraph
Top achievements
Rank 1
answered on 16 Sep 2010, 11:42 AM
Unfortunately not, that stops the ticker control from working at all.
0
Fiko
Telerik team
answered on 21 Sep 2010, 02:02 PM
Hello Phil,

It appears to be a general problem with the configuration but for the time being I cannot tell what exactly is causing the problem. Could you please open a new support ticket and send me a runnable project which shows your setup? I will debug the issue on my side and do my bets to provide a working solution as soon as possible. Also, it will be of help if you send me a live URL to the page where the problem exists.

Greetings,
Fiko
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
Srujan
Top achievements
Rank 1
answered on 21 Jan 2011, 07:15 PM
Hi All ,

We have add below line in web.config to over come this issue

<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

Regards
Srujan.N
Tags
General Discussions
Asked by
Eraph
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Eraph
Top achievements
Rank 1
Fiko
Telerik team
Srujan
Top achievements
Rank 1
Share this question
or