tags:

views:

49

answers:

1

I am trying to execute a method in ASP.NET from Jquery

$.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "MyMessages.aspx?id=66&epslanguage=sv/test",
        data: "{}",
        dataType: "json",
        error: function(xhr, err) {
        alert("readyState: " + xhr.readyState + "\nstatus: " + xhr.status);
        alert("responseText: " + xhr.responseText);
            },
        success: function() {
            alert("it works" );
        }
    })

code behind:

    [WebMethod]
    protected void test()
    {
        test.Text = "works";
    }

I get errormessage redayState: 4 and status 200 when I do this. I don't understand the problem. I am vey new at this. :)

+1  A: 

data: "{}", should be just data: {}, or just remove it if not in use,,..

Reigel
still not working
brajt