AJAX in a SharePoint WebPart

5 posts, 0 answers
  1. Eraph
    Eraph avatar
    11 posts
    Member since:
    Aug 2010

    Posted 10 Sep 2010 Link to this post

    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?
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2782 posts

    Posted 15 Sep 2010 Link to this post

    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
  3. Eraph
    Eraph avatar
    11 posts
    Member since:
    Aug 2010

    Posted 16 Sep 2010 Link to this post

    Unfortunately not, that stops the ticker control from working at all.
  4. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 21 Sep 2010 Link to this post

    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
  5. Srujan
    Srujan avatar
    18 posts
    Member since:
    Oct 2010

    Posted 21 Jan 2011 Link to this post

    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
Back to Top