Known Issue & Fix: Components that call web services no longer work after migrating to ASP.NET AJAX Beta 1

Last post 12-05-2006 7:06 AM by NNM. 6 replies.

Sort Posts:

  • Known Issue & Fix: Components that call web services no longer work after migrating to ASP.NET AJAX Beta 1

    10-25-2006, 7:48 PM
    • Contributor
      4,346 point Contributor
    • sburke_msft
    • Member since 04-04-2006, 7:28 PM
    • Redmond, WA
    • Posts 770
    • AspNetTeam

    Summary:

    Components that call web services or page methods stop working after migrating to ASP.NET AJAX Beta 1.  You may see errors such as [Method Error 12031] or [Method Error 500].

    Fix:

    Web Services that you plan to call from client code must be decorated with the Microsoft.Web.Script.Services.ScriptServiceAttribute.

    [Microsoft.Web.Script.Services.ScriptService()]

    public class MyService : System.Web.Services.WebService {

     // ...

    }

    There has also been a change to the usage of PageMethods for ASP.NET AJAX Beta 1.  PageMethods must now be static (Shared in VB) in order for them to be accessible from script, and must be decorated with the Microsoft.Web.Script.Services.ScriptMethodAttribute.  Moreover, due to a known issue in ASP.NET AJAX Beta 1, they must be delcared in the ASPX file, and will not work if declared in the code behind file:

    <script runat="server">

    [System.Web.Services.WebMethod]

    [Microsoft.Web.Script.Services.ScriptMethod]

    public static string GetHtml(string contextKey) {

    // ...

    }

    </script>

     

    Don't forget, this posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Known Issue & Fix: Components that call web services no longer work after migrating to ASP.NET AJAX Beta 1

    10-26-2006, 6:00 PM
    • Member
      5 point Member
    • jtheisenpdx
    • Member since 10-26-2006, 9:55 PM
    • Posts 1
    I am rolling back to the previous (pre Beta 1) version of AJAX, Atlas, because this new release is not even close to ready yet. I can live with having to put the code in the page. I CANNOT live with this method having to be declared as static! Having a contextKey is not nearly as flexible as the previous model. If this is the way that the AJAX library is heading, then I will need to look for an alternate JavaScript AJAX scripting library. Which is a shame as the Atlas version of this worked perfectly.
  • Re: Known Issue & Fix: Components that call web services no longer work after migrating to ASP.NET AJAX Beta 1

    10-27-2006, 11:44 AM
    • All-Star
      123,542 point All-Star
    • XIII
    • Member since 07-01-2002, 3:59 AM
    • Essen, Belgium
    • Posts 13,664
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    It seems you're not the only one with that point of view: http://weblogs.asp.net/despos/archive/2006/10/25/Don_2700_t-call-it-Beta-1.aspx.

    Hopefully Microsoft will clear things up a bit at TechEd Barcelona in a couple of weeks.

    Grz, Kris.

  • Re: Known Issue & Fix: Components that call web services no longer work after migrating to ASP.NET AJAX Beta 1

    10-31-2006, 1:09 PM
    • Member
      5 point Member
    • mogmem
    • Member since 10-31-2006, 4:33 PM
    • Posts 1
    Greetings,

    Being able to access a page scoped variable via an instance method on a codebehind Page using (ex) Sys.Net.PageMethod.invoke has been key to our planned use of the Microsoft Ajax framework. The workaround and limitation to a static method call as described doesn't address that requirement and doesn't provide a fix to the lost functionality.

    Please could someone suggest how we might now alternativey modify a page scoped variable sourced on a clientside Javascript event in the current Ajax framework and/or could someone in the Microsoft team make a statement to confirm that the functionality will be returned in an upcoming release, either way so that we can plan accordingly.

    Example of issue:
    The AjaxControlkit DynamicPopulate sample's use of the GetHtml method in the change from Atlas (ie. Microsoft.Web.Atlas.dll build 2.0.50727.60725 release) to Ajax 1.0 Beta is a good representation of the issue and the functionality we'd like to see back in the framework.

    Thx!
    Marc
  • Re: Known Issue & Fix: Components that call web services no longer work after migrating to ASP.NET AJAX Beta 1

    11-02-2006, 7:04 PM
    • Member
      30 point Member
    • fawlty
    • Member since 11-02-2006, 4:30 AM
    • Posts 6

    I hope a fix for this comes out soon, as I assume this is important for many of us. It's funny that the HoverMenu showcase page on the website had to remove functionality because of this bug...

  • Re: Known Issue & Fix: Components that call web services no longer work after migrating to ASP.NET AJAX Beta 1

    11-02-2006, 7:05 PM
    • Member
      30 point Member
    • fawlty
    • Member since 11-02-2006, 4:30 AM
    • Posts 6
    OOps, wrong thread. Embarrassed
  • Re: Known Issue & Fix: Components that call web services no longer work after migrating to ASP.NET AJAX Beta 1

    12-05-2006, 7:06 AM
    • Participant
      1,386 point Participant
    • NNM
    • Member since 09-07-2006, 5:04 AM
    • Posts 540
    "Methods cannot be declared as 'static'."
    Validation Complete
    ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
    I'll always mark your post(s) as answer when it is!
Page 1 of 1 (7 items)