Web Method[Page Method] is not working after Migrating Telerik from 2012 to 2013 version

2 posts, 0 answers
  1. Raj
    Raj avatar
    1 posts
    Member since:
    Sep 2013

    Posted 25 Sep 2013 Link to this post

    Hi Team,

    We upgraded Telerik version from 2012 to 2013.After migration,All "webmethods" calls are failling.we are getting "Authentication Failed" error.The same code is working fine in Telerik version 2012.Our Implementaion is as follows,

    In Class1.cs

    [WebMethod(enablesession="true")]
    Public static string Test(String s)
    {
    return "Sucess";
    }

    In Aspx
        function OnSuccess(response)
         {
               alert
    (response);
         
    }
        function OnError(error) 
        {
              alert
    (error);
        }
        function CallTest() 
        {
            PageMethods.Test("sample",OnSuccess, OnError);
        }

    Incase someone has faced a similar issue and fixed it,Could you please share the steps/settings  what you have done for fixing this issue.

    Thanks in advance,
    Raj
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Sep 2013 Link to this post

    Hi Raj,

    Please have a look into the following code I tried with Telerik RadControls 2013 version.

    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" Text="Call Method" OnClientClicked="CallTest">
    </telerik:RadButton>

    JavaScript:
    <script type="text/javascript">
        function CallTest() {
            PageMethods.Test("sample", OnSuccess, OnError);
        }
        function OnSuccess(response) {
            alert("Success");
        }
        function OnError(error) {
            alert("Error");
        }
    </script>

    C#:
    [WebMethod(EnableSession=true)]
    public static string Test(string s)
    {
        return "Success";
    }

    Thanks,
    Shinu.
Back to Top