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

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

1 Answer 196 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 25 Sep 2013, 02:09 PM
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

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Sep 2013, 09:50 AM
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.
Tags
General Discussions
Asked by
Raj
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or