Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • sudeer 24 posts 42 karma points
    Jul 25, 2011 @ 16:08
    sudeer
    0

    How to Call asmx webservice method in master page in umbraco using Jquery with out posting the page

    I tried using /base call, but the postback is happening

  • Richard Soeteman 4054 posts 12927 karma points MVP 2x
    Jul 25, 2011 @ 16:21
    Richard Soeteman
    0

    Hi,

    Are you using server controls/ buttons etc that's calling the webservice? Maybe give a little bit more info so we can help you with your issue.

    Cheers,

    Richard

     

  • sudeer 24 posts 42 karma points
    Jul 26, 2011 @ 07:43
    sudeer
    0

    Hi,

    yes, i have a button in the master page, on client click of that i am calling the below javascript function

    function Testclick() {

                var uname = "Testname";
                var eorder = "testorder";
                $.get("/base/TestAlias/StoreDragDropDetails/" + uname + "/" + eorder + ".aspx", function (data) {
                    alert('Data Loaded');
                });
                return false;
            }

    Here i am using the /base call to post the data...

    Please let me know weather this approach is correct or is there some other way i can send the parameters to server side.

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Jul 26, 2011 @ 10:14
    Michael Latouche
    0

    Hi,

    Did you try using the $.ajax method? This does an ajax call to the target page / webservice, so no postback.

    Hope this helps.

    Cheers,

    Michael.

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Jul 26, 2011 @ 10:26
    Michael Latouche
    0

    To be a little more specific, I think your ajax call would be something like this:

    function Testclick() {

                var uname = "Testname";
                var eorder = "testorder";
                $.ajax({
                      url: "/base/TestAlias/StoreDragDropDetails/" + uname + "/" + eorder + ".aspx",
                      type: "GET",
                      success: function (data) {
                                alert('Data Loaded');
                              },
                      error: functrion(){
                               alert('error');
                             }
                });
                return false;
            }
    }

  • sudeer 24 posts 42 karma points
    Jul 26, 2011 @ 15:13
    sudeer
    0

    Its working now, Thanks for all your help.

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Jul 26, 2011 @ 15:23
    Michael Latouche
    0

    You're welcome :-)

    Glad to hear you worked it out.

    Cheers,

    Michael.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies