Tag Info

Hot answers tagged

6

You can use the ECMA Script Client Object Model: ExecuteOrDelayUntilScriptLoaded(loadWebs, "sp.js"); function loadWebs() { var clientContext = new SP.ClientContext.get_current(); this.webs = clientContext.get_web().get_webs(); clientContext.load(this.webs); clientContext.executeQueryAsync(Function.createDelegate(this, ...


5

I was able to add a file with SP.RequestExecutor <%-- _lcid="1033" _version="15.0.4128" _dal="1" --%> <%-- _LocalBinding --%> <%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" ...


4

It's throwing the error because the <asp:ScriptManager> tag is most likely defined in your master page, causing two instances on the page you are trying to load. http://social.msdn.microsoft.com/Forums/br/sharepoint2010general/thread/54c271ee-de71-4e47-b02b-29a1d540b81c


4

SharePoint is a huge historical monster. Core of the current paging implementation was introduced long ago, probably in SP2010 or even earlier. That's why your approach doesn't work: SharePoint isn't finding some html elements that are supposed to be there, and falls back to a simpler approach with link. Investigation Here is why it happens (you may skip ...


4

Juergen, The below article should help: http://blog.collabware.com/2013/03/22/tips-tricks-sharepoint-2013-modal-dialogs/ You have SP.UI.ModalDialog.showWaitScreenWithNoClose which can be used.. function RequestEnded(sender, args) { try { waitDialog.close(); waitDialog = null; } catch (ex) { } }; function RequestStarted(sender, args) { ...


4

Your issue is in understanding the async nature of JavaScript. The reason why there are no values is because you are attempting to access it before the executeQueryAsync function has returned and done it's job. Any logic that needs to access the values in globalTitle needs to be abstracted into a function or functions that can be invoked inside of the ...


3

The service needs to be AJAX enabled to generate a javascript proxy for you. Lists.asmx is not AJAX enabled. [WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1), WebService(Namespace="http://schemas.microsoft.com/sharepoint/soap/")] public class Lists : GenericService, ISoapServiceLists, ISoapServiceListData, ISoapServiceListSchema, ...


3

I just did a test with SPServices where I set a Single line of text column to an empty string (""), which seemed to work just fine. This was with WSS 3.0 (the simplest test case, IMO). $().SPServices({ operation: "UpdateListItems", async: false, debug:true, listName: "Sales Opportunities", ID: 5, valuepairs: [["StateID", ""]], ...


3

I would recommend that your teams build all their products against version 3.5 of the .NET framework. If necessary you can map DLL versions in your web.config file using bindingRedirect to use the newer version of AJAX Extensions. You might need additional SafeControl entries if you have multiple versions.


3

I've done ajax a few different ways. When deving webparts I usually try to use the ICallbackEventhandler (http://msdn.microsoft.com/en-us/library/system.web.ui.icallbackeventhandler.aspx), especially when creating webparts that need ajax. I've also had a scenario when I used an update panel ...


3

SharePoint works great with AJAX. Two of the great improvements for SharePoint 2010 was Client Side Object Model and REST interface which makes JavaScript development against SharePoint a lot easier that using the old Web Services. Another great option which makes a the Web Services usable and provides a lot of great functionality (and good documentation) ...


3

Since it is an intranet, I think worrying this much is a little over the top. I guess with fiddler around, anyone can modify their ajax response to the server, so I guess I'm not really following you about why an update panel is more secure than another implementation (such as icallbackeventhandler)? Are you counting on the postback security validation ...


3

Have a look at http://blog.jsonpify.com/ or, as suggested on the blog above, have a look at http://developer.yahoo.com/yql/ YQL can be called from client script using JSONP, allowing you to pass a SQL-ish query against an "Open Data Table". An Open Data Table is an abstraction layer similar to a BCS model in SharePoint. An Open Data Table abstracts web ...


3

See if these paths to the row count variables work: data.d.query.PrimaryQueryResult.RelevantResults.RowCount data.d.query.PrimaryQueryResult.RelevantResults.TotalRows If you have specific questions about the object model, I find that the best first point of reference is to look at the returned xml or json using web developer tools and looking at the ...


3

You need to use the $expand option in your query string. siteUrl + "/_api/lists/getbytitle('" + listName + "')/items?$select=NameOfLookup/FieldYouWant&$expand=NameOfLookup/NameOfFieldYouWant" So yours would be: "/_api/lists/getbytitle('" + listName + "')/items?$select=$expand=status_x0028_test_x0029/Title&$expand=status_x0028_test_x0029/Title ...


2

I'd suggest you start learning and using the Sharepoint 2010 Client OM (Client Object Model). You can read more about it here : http://blogs.technet.com/b/speschka/archive/2009/11/01/using-the-sharepoint-2010-client-object-model-part-1.aspx Also, if you write your asp.net code properly, you shouldn't have issues data being submitted again. One example of ...


2

finally i figured out and below is the updated code: hope this will help others.. protected override void CreateChildControls() { if (!this._error) { try { base.CreateChildControls(); UpdatePanel updatePanel1 = new UpdatePanel(); ...


2

Dare i ask why you wouldn't just use SPServices (created by @sympmarc), an open source jQuery plugin that wraps methods in the OOTB SharePoint Web / WCF Services, making the use of these services in JavaScript as simple as the following example: $(document).ready(function() { $().SPServices({ operation: "GetListItems", async: false, listName: ...


2

I find it very hard to understand your exact criteria for setting the item in the SELECT box. But you should be able to accomplish this with JQuery in a HTML Form webpart. Here is a pseudo-code example. $(document).ready(function(){ //Criteria to determine the value to select. ...


2

I think the issue is that the options you are adding to the select don't have the same ids as the values in the source list. You're using the Title for both the option text and the value. Assuming that the DropDownChoice is a Lookup column, you need to use the right id for each option to match what would be saved if you weren't running your script.


2

I largely agree with Per on this one. (+1 Per) Loading JS from another server, especially when using HTTPS for SharePoint causes warnings in IE about loading unsecured/untrusted resources (I can't exactly remember the message). You can load JQuery (for example) from a CDN just fine but this is the problem we had when doing this. Also from memory, I think ...


2

On the security side UpdatePanel and pure AJAX are exactly the same. When posting using AJAX you can also check CurrentUser The differences between UpdatePanel and pure AJAX are: Ease of implementing. UpdatePanel is very easy. Pure AJAX requires more work Performance. UpdatePanel is doing a full page postback, just skipping some rendering parts. Pure AJAX ...


2

It is difficult to point out the exact reason for the issue. Here are som thougts which maybe can help you finding the solution: I have some posts about httphandlers in sharepoint on my blog, among them an answer on sharepoint.stackexchange: How to access a Web application/Farm level property bag via jQuery/Javascript/ClientContext Take a look on some ...


2

I think that calling ASP.NET page method from a jQuery requires that the method being called be marked static and with the [WebMethod] attribute. Also, please note that jQuery can call ASP.NET page methods. Methods in a SharePoint Visual WebPart are technically user controls. Here is another question that covers this topic. As noted by Tim Ebenezer in ...


1

Solved! Sort of... I never figured out how to get the list items from xData.responseXML. However, simply replacing it with xData.responseText instead was enough to get the code working. Now find("z\\:row") finds all the list items as expected. Works in both ie,ff and chrome. I ended up modifying the contents of the each-loop a bit though. Here's the ...


1

regarding jQuery and $.ajax you might be having the following trouble regardless of your settings on the ajax call. http://api.jquery.com/jQuery.ajax/ From the documentation: Additional Notes: Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a ...


1

I've been experiencing the same problem. I have a SharePoint dashboard where all my custom webparts reside (currently 9 webparts). All webparts retrieve their data from web services and while using AJAX with the Timer works well in terms of initial page load, it can take up to 30 seconds for the last webpart in the sequence to get its data which doesn't look ...


1

I'm not really a developer, but I believe the core of the problem is that ASP.NET processes each page request using a single thread (even where there are multiple Web parts). An UpdatePanel is a really a page-postback and AFAIK it can only post one event at a time. As such, you will most likely need to create and register asynchronous tasks (i.e. using ...



Only top voted, non community-wiki answers of a minimum length are eligible