locked
Asp.net ajax webservice not working In first call RRS feed

  • Question

  • User-504606082 posted

    i have created  webservice and i will call this webservice from javascript in asp.net. When i  run this in local its is  working fine, But when it moved to the production and accessing the page using url. First time it is not called to the websevice .but i refresh the page it is working ... i dont find any reason for  this ..please suggest me...

    Tuesday, September 2, 2014 9:38 AM

All replies

  • User1918509225 posted

    Hi saikumarneelam,

    For your issue ,i sugges that you can use F12 to debug the page ,when you first load your page and fire ajax request to your service method.

    See if it has any error message.

    Best Regards,

    Kevin Shen.

    Wednesday, September 3, 2014 2:51 AM
  • User-504606082 posted

    Thanks for the reply,

    I was checked based on your suggestion i got an error in Where(from java script) i called the webservice. I am getting an error is 'Uncaught reference error: Webservice is not defined".
    Till now what i was done some research in that i found it behaves differently like some time it will called and some time it won't work..

    Can you please help me how to solve this issue..

    Thanks,

    sai.

    Friday, September 5, 2014 2:42 AM
  • User1918509225 posted

    Hi ,

    Could you explain in which sutiation the ajax can not call the  service method?

    Best Regards,

    Kevin Shen.

    Friday, September 5, 2014 2:57 AM
  • User-504606082 posted

    The Below service call  code i was written in javascript..

    $("#dropdown").change(function () {
    WebserviceService.GetHotels(strIDMetro, OnSuccessHotels, OnFailure);

    }
    });

    Thanks,

    sai

    Tuesday, September 9, 2014 2:21 AM
  • User1918509225 posted

    Hi ssaikumarneelam,

    If you are using ajax call webservice,maybe you need to try code like below,:

    $.ajax({
                    type: "POST",
                    url: "MyService.asmx/SayHello",
                    data: "{firstName:'aa'}",                
                    dataType: "json", 
                    success: function (data) {
                                     }
                });
    

    and I am not quite sure what you WebserviceService mean .


    Best Regards,

    Kevin Shen.

    Friday, September 12, 2014 4:49 AM