Skip to main content
3 of 4
added 416 characters in body
sharmila
  • 593
  • 1
  • 8
  • 19

sharepoint sandboxed solution make ajax post call

I have created a sandboxed solution for SharePoint 2010 which contains sandboxed visual webpart. I need to make ajax POST call and pass the entities from javascript. can you tell me how can I accomplish this requirement? How can we load the .aspx page and where will I write the code behind so that I can get the variables passed using ajax POST?

$.ajax({
 url: "https://mydomain.com/Sandbox/webservice/page.aspx",
  beforeSend: function (xhr){
         xhr.setRequestHeader('command', 'name');
        },
        type: "POST",
        dataType: "html",
        success:function(){var x=something}
          timeout: 5000,  
    });

Now my question is how can i load the aspx page and how can i access the entities like "command" from code behind?

sharmila
  • 593
  • 1
  • 8
  • 19