Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

My Error is:
Microsoft JScript runtime error: Unable to get value of the property '_staticInstance': object is null or undefined.



My asmx service code:
C#
[WebMethod]
       public string RedirectToLogin(string UserControl, string language, string country, string steps)
       {
           string redirectpage = string.Empty;
           Langauge.RequestRedirectPage Rp = new Langauge.RequestRedirectPage();
           redirectpage = Rp.getRedirectPage(UserControl, language, country, steps);
           return redirectpage.ToString();
       }



My Javascript code:

C#
function load123() {
        Namespace1.RedirectToLogin("Registration", "dk", "denmark", "step2", onSuccess123, onfailedfun);
    }


function onSuccess123(resul) {
    window.location = resul;
    }
    function onfailedfun(res) {
    }


service calling from aspx page:

XML
<asp:ScriptManager ID="ScriptManager2" runat="server">
           <Services>
               <asp:ServiceReference Path="~/Shop.asmx" />
           </Services>
       </asp:ScriptManager>


Runtime getting from JSDebug[dynamic] page:
Shop._staticInstance.RedirectToLogin(UserControl,language,country,steps,onSuccess,onFailed,userContext); }


thanks in advance.
Posted
Updated 9-Jul-13 4:08am
v4
Comments
bbirajdar 9-Jul-13 9:36am    
I am also not able to understand the reason because I cant see any code...
ZurdoDev 9-Jul-13 9:51am    
Use the improve question link, post the relevant code, and show us where it is happening. Otherwise, how can we know why?

Usually if you are calling a method from asmx to be used in jquery it should be static method.
 
Share this answer
 
Make the method RedirectToLogin as static like
C#
public static string RedirectToLogin(string UserControl, string language, string country, string steps)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900