Copied to clipboard

Flag this post as spam?

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


  • David F. Hill 122 posts 242 karma points
    Apr 09, 2010 @ 08:57
    David F. Hill
    0

    jQuery Ajax post method not passing data

    Hello Umbraco Colleagues,

    I really hope someone has an answer for this:

    I have an Umbraco template with a little bit of jquery to post some data back to umbraco.

    Everything is working if I enter the url into the browser directly like this:

    http://localhost:8485/RUpdate.aspx?op=add&radioId=9988

    When I call the post method from within an Umbraco template - the data is not being passed and the querystrings are null. Here's how I'm calling the post method:

    $.post("/rupdate.aspx", "op=add&radioId5555");

    rupdate.aspx is getting called but no querystrings are passed.

    I've tried everything I can think of. Can anyone see what's wrong?

    Thanks,

    David Hill

    Umbraco 4.0.2.1; IIS 7; SQL 2008

     

  • David F. Hill 122 posts 242 karma points
    Apr 09, 2010 @ 09:04
    David F. Hill
    0

    Hello:

    Correction to the above:

    The post method should read:

    $.post("/rupdate.aspx", "op=add&radioId=5555");

    the missing equal sign is not the problem.

    DfH

     

     

  • dandrayne 1138 posts 2262 karma points
    Apr 09, 2010 @ 11:03
    dandrayne
    0

    Does this return anything for you?

    $.post("/rupdate.aspx", { op: "add", radioId: "5555" },
    function(data){
    alert("Data Loaded: " + data);
    });

    Dan

  • Petr Snobelt 923 posts 1535 karma points
    Apr 09, 2010 @ 14:04
    Petr Snobelt
    0

    If you want simulate your url you should use get method not post.

    Post add items into Request.Form and get into Request.QueryString collection.

    Petr

  • David F. Hill 122 posts 242 karma points
    Apr 09, 2010 @ 20:05
    David F. Hill
    0

    Thank you, Petr.

    That was exactly the problem. I had tried GET earlier but must not have had everything else configured correctly - so I assumed that wasn't the issue.

    Thank you very much for your reply.

    David Hill

  • David F. Hill 122 posts 242 karma points
    Apr 09, 2010 @ 20:07
    David F. Hill
    0

    Dan -

    Thanks for your reply. It turned out to work as expected when I used the GET method instead of POST.

    David

Please Sign in or register to post replies

Write your reply to:

Draft