Tag Info

New answers tagged

0

I used this syntax and it is working fine: Application Page: [System.Web.Services.WebMethod] public static string myWB() { return "my HTML or JSON" } The call from the visual web part is same as yours. So maybe try to add just [System.Web.Services.WebMethod] to your method.


0

I fix it by switching to use Rest API :) var fileContentUrl = appweburl + "/_api/web/GetFolderByServerRelativeUrl('" + finalFolderUrl + "')/Files('" + fileName + "')/$value"; var info = { url: fileContentUrl, method: "GET", //headers: { "Accept": "application/json; odata=verbose", "X-RequestDigest": ...


0

In your Ajax code, we read: url: "/Layouts/SendUsEmail/Handler1.ashx", While it should be: url: "/_Layouts/SendUsEmail/Handler1.ashx", note the '_' in front of "Layouts".


0

var hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl")); var appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl")); Instead of, var hostweburl; var appweburl; // Load the required SharePoint libraries $(document).ready(function () { //Get the URI decoded URLs. hostweburl = decodeURIComponent( ...


1

Yes, it is possible to use AngularJS with REST calls in SharePoint hosted apps, as illustrated here. You should create you own service beside the controller, and rely on promisses. For example, the service can be: myAngApp.service('spCustomerService', function ($q, $http) { this.getCustomers = function ($scope) { var appWebUrl = ...



Top 50 recent answers are included