locked
sharepoint sandboxed solution make ajax post call RRS feed

  • Question

  • 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 page.aspx page and how can i access the entities like "command" from code behind? Is this possible? if yes then please help me how to do it.

    Also one more thing i have noticed it we cannot deploy normal .aspx page to sharepoint server using sandboxed solution. Then how can we publish the aspx page and use it for making ajax calls?

    Tuesday, October 16, 2012 7:09 AM

All replies

  • Yes it is possible!

    Check my blog: http://sharepointsandboxed.blogspot.nl/2012/10/how-to-get-data-from-application-page.html

    The thing is that you would load a complete page with jQuery and then find a certain control inside the result, this result contains your data.


    Martijn

    Monday, March 11, 2013 6:59 PM