Ajax Toolkit in SharePoint 2013

I want to use Ajax controls in my visual web part in sharepoint 2013.i've dowloaded toolkit from the following url
http://ajaxcontroltoolkit.codeplex.com/
Can anyone tell me steps to add ajax toolkit in my visual webpart project and any other necessary step in order to use ajax in visual webpart for sharepoint 2013.

I wanted to use ajax controls in visual webpart for sharepoint 2013 so i followed steps.
1-I cut this snippet (see below) from <head></head> Section and paste in <body></body> Section for my master page since it's a requirement for SharePoint 2013 ajax functionality.
Snippet:
<!--MS:<SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server">-->
<!--MS:<WebPartPages:SPWebPartManager runat="server">-->
<!--ME:</WebPartPages:SPWebPartManager>-->
<!--ME:</SharePoint:AjaxDelta>-->
2-downloaded a latest ajax tool kit and then added ajax toolkit dll from the toolkit library in my solution's bin-->debug folder
now add ajax entries in web.config in these sections
in <SafeControls>
      <SafeControl Assembly="ajaxcontroltoolkit, Version=4.1.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e, processorArchitecture=MSIL" Namespace="AjaxControlToolkit" TypeName="*" />
in <assemblies>
<add assembly="AjaxControlToolkit, Version=4.1.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
in <controls>
<add tagPrefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, Version=4.1.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
finally registered ajax in visual web part as 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxtoolkit" %>
added following calender control
<asp:TextBox MaxLength="10" ID="txtToDate" runat="server" CssClass="FormTextBoxSmall"></asp:TextBox>
<asp:ImageButton ID="calReqDateTo" runat="server" ImageUrl="" />
<ajaxtoolkit:CalendarExtender id="CalendarExtender2" runat="server" targetcontrolid="txtToDate"
    format="dd/MM/yyyy" popupbuttonid="calReqDateTo" />
reset iis and deployed my solution but when i deployed it throws error 
"could not load file or assembly AjaxToolkit,Version=4.1.7.1213 "
please help
 

Similar Messages

  • AJAX TabContainer in SharePoint 2013

    I am trying to implement AJAXToolkit Tabcontainer control in SharePoint 2013 inside a web part.I have done the following.
    1.Put AjaxControlToolkit in GAC
    2.Added entry for it in web.config
    I am facing the following issues.
    1.The control does not show up on the page.On doing F12, I see that the visibility is set to hidden even though I explicitly set it to true in the code.
    2.The tabs do not change on click.
    Please help.

    Hi,
    According to your post, my understanding is that the AJAXToolkit Tabcontainer control does not show up on the page.
    Please make sure you use the control correctly.There is an article for your reference, although it is about the SharePoint 2010, it is similar to SharePoint 2013.
    http://ranaictiu-technicalblog.blogspot.com/2010/08/ajax-control-toolkit-with-sharepoint.html
    In addition, please make sure you download the new version, add a reference in the <assemblies> section of the web.config file and add the following line into the .ascx user control file: 
    <%@
    Register Assembly=”AjaxControlToolkit”
    Namespace=”AjaxControlToolkit”
    TagPrefix=”asp” %> 
    Here is a similar thread for your reference:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/51d4a039-5a77-450a-9d38-f8bd9e08e7c7/ajaxtoolkittabcontainer-not-working-in-webpart-page
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Ajax in Sharepoint 2013 Sandboxed solution

    I want to use ajax in sandboxed solution for sharepoint 2013,is it possible we can use ajax in sandboxed solution ?
    if yes  then please me know the steps to implement ajax in sandboxed solution for sharepoint 2013.
    if we cannot use ajax in sandboxed solution then please let me know the steps to implement in farm solution for sharepoint  2013 also please mention which version of ajax toolkit we can use in sharepoint 2013

    Hi,
    We can use jQuery Ajax in the sandboxed solution, the following thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/cb69509c-7740-4903-be93-c2bb66aa7ad3/sharepoint-sandboxed-solution-make-ajax-post-call?forum=sharepointgeneralprevious
    We can also customize web services in SharePoint Online.
    Custom Webservices with SharePoint Online for Office 365
    http://www.codeproject.com/Articles/327919/Custom-Webservices-with-Sharepoint
    In SharePoint 2013, I suggest you create a APP to achieve your requirement.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • SharePoint 2013 RSS Viewer not loading when other Custom web part using Update Panel or Ajax Timer control

    Hi,
    SharePoint 2013 RSS
    Viewer web part failing to complete loading when the page loads.
    This happens when having RSS Viewer and then adding a Custom webpart with an updatepanel and timer control.
    I  had used Ajax update panel and timer control to load the web part asynchronously after the main page is fully loaded.
    The RSS-Viewer web part hangs in loading state while the custom webpart loads just fine.
    The issue occurs when an like button click or Timer Tick event fires after the page
    is loaded.
    Haven't been able to track the issue.
    Couple of workaround I tried to call a server side button click event from the custom web part after the page gets fully loaded using JQuery shown below did not work out either.
     $(document).ready(function () {
                $('#<%= netButton2.ClientID %>').click();
    And 
    document.onreadystatechange = function () {
                if (document.readyState == "complete") {
                    $('#<%= netButton2.ClientID %>').click();
    Please let me know how to resolve this issue.
    Thanks,
    Franklin

    Hi Johan,
    The assignment of this user on the given task might be corrupted. Try to remove the resource from the task, publish the project, assign the resource again and publish again the project. If it is not working, try to unpublish the task (column "publish")
    and publih it again.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Issue with AjaxControlToolkit for SharePoint 2013 Blog site template.

    Hi,
    Please find below the details of issue -
    History - We are working with SharePoint 2013 and we are using AjaxControlToolkit in our project. Basically this is a migration project from MOSS to SharePoint 2013. So we have migrated code MOSS to SharePoint 2013. Previously in MOSS project, AjaxControlToolkit
    was used so after migrating we have also used AjaxControlToolkit with updated version which can work in SharePoint 2013. This is working fine now.
    Scenario - There is one web application in SharePoint 2013 farm. Under this web application there are two site collections. One site collection is created with Team site template and second site collection is created with Blog site template.
    There are three feature in our wsp that we have created. One feature is at web application scope (which will do web.config modifications and it will add below entry in web.config file through SPWebConfigModification in section 'configuration/system.web/compilation/assemblies'
     <add assembly="AjaxcontrolToolkit, Version=4.5.7.725, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />  
    ). And there are two site collection features.
    Now when we deploy our solution (wsp) to web application in SharePoint 2013 farm and activate the Web.Config modification feature which is at web application level, it has added above mentioned entry in web.config file.
    Our application in first site collection is working fine which we are expecting but in the second site collection which is created using out of box Blog site template, 'comment box' and Post button are invisible as shown in below screen shot -
    If we remove below entry from web.config file -
    <add assembly="AjaxcontrolToolkit, Version=4.5.7.725, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" /> 
    and refresh the Blog site page then the Comment box and Post button is appearing again as shown in below screen shot -
    We also tried with updated versions of AjaxControlToolkit (Version=4.5.7.1005 & 4.5.7.1213) but no success.
    I will highly appreciate if you could help me in this.
    Thanks for your time.
    Thanks & Regards,
    Rajendra Gaikwad.

    Hi,
    As you said, the issue only comes with the Blog site template.
    I suggest you take a look at this blog about how to make Ajax Control Toolkit work with SharePoint 2013:
    http://andreaswijayablog.blogspot.com/2013/12/ajax-control-toolkit-with-sharepoint.html
    Another similar thread for your reference:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/60fa19fe-86a0-446b-b61f-11a82fe4287f/how-to-implement-ajax-toolkit-for-sharepoint2013?forum=sharepointdevelopment
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they
    help and unmark them if they provide no help. If you have feedback for TechNet
    Subscriber Support, contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Could not load file or assembly AjaxToolkit error in SharePoint 2013 Visual Webpart

    I wanted to use ajax controls in visual webpart for sharepoint 2013 so i followed steps.
    1-I cut this snippet (see below) from <head></head> Section and paste in <body></body> Section for my master page since it's a requirement for SharePoint 2013 ajax functionality.
    Snippet:
    <!--MS:<SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server">-->
    <!--MS:<WebPartPages:SPWebPartManager runat="server">-->
    <!--ME:</WebPartPages:SPWebPartManager>-->
    <!--ME:</SharePoint:AjaxDelta>-->
    2-downloaded a latest ajax tool kit and then added ajax toolkit dll from the toolkit library in my solution's bin-->debug folder
    now add ajax entries in web.config in these sections
    in <SafeControls>
          <SafeControl Assembly="ajaxcontroltoolkit, Version=4.1.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e, processorArchitecture=MSIL" Namespace="AjaxControlToolkit" TypeName="*" />
    in <assemblies>
    <add assembly="AjaxControlToolkit, Version=4.1.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
    in <controls>
    <add tagPrefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, Version=4.1.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
    finally registered ajax in visual web part as 
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxtoolkit" %>
    added following calender control
    <asp:TextBox MaxLength="10" ID="txtToDate" runat="server" CssClass="FormTextBoxSmall"></asp:TextBox>
    <asp:ImageButton ID="calReqDateTo" runat="server" ImageUrl="" />
    <ajaxtoolkit:CalendarExtender id="CalendarExtender2" runat="server" targetcontrolid="txtToDate"
        format="dd/MM/yyyy" popupbuttonid="calReqDateTo" />
    reset iis and deployed my solution but when i deployed it throws error 
    "could not load file or assembly AjaxToolkit,Version=4.1.7.1213 "
    please help

    Hi,
    In this below thread they have discussed and resolved your issue.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/60fa19fe-86a0-446b-b61f-11a82fe4287f/how-to-implement-ajax-toolkit-for-sharepoint2013?forum=sharepointdevelopment&prof=required
    Please let us know if you need further details
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • Multiple file upload in SharePoint 2013 using AjaxFileUpload

    Hi all,
    I want to add multiple files using file upload control in our visual web part SharePoint 2013. I tried to use AjaxFileUpload (from Ajaxcontrol toolkit) in my visual web part and also added the handler in web.config as described in article (http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ajaxFileUpload/ajaxFileUpload.aspx).
    But, it’s not even opening the browse dialog box.
    I also tried to see if any third party control is available to achieve multiple file upload in SharePoint 2013 Visual web part, but without any success.
    Please help.
    Regards,
    Monica

    Hi
    Try to add the dll files of Ajax Control Toolkit in the
    Bin folder of your SharePoint Web Application (IIS Site)
    Hope that help
    Ahmed Naji SharePoint Geek
    MCP|MCTS|MCPD
    My English SharePoint Blog | DotnetFinder My Arabic SharePoint Blog|
    CodeReloaded
    My Gallery Contributions
    SharePoint 2010 Twitter Web Part
    SharePoint 2010 Custom Timer Job

  • How to implement Ajax toolkit for SharePoint2013?

    Hi All,
    How to implement Ajax toolkit for SharePoint2013?

    Hi Sam,
    Based on your description,
    I can suggest as follows:
    Use the “SharePoint AJAX 3.5 for 2010 and 2013”
    solution.
    Download URL:
    http://sharepointajax.codeplex.com/
    2.    
    Use the Ajax Control Toolkit with ASP.NET 4.5.
    Download correct version of Ajax Control Toolkit.
    http://ajaxcontroltoolkit.codeplex.com/releases/view/109918
    Add AjaxControlToolkit.dll reference to your project.
    Add Ajax Control Toolkit ScriptManager in master page.
    Register Ajax Control Toolkit namespaces in SharePoint package Designer.
    More information:
    http://timscyclingblog.wordpress.com/2013/03/22/ajaxcontroltoolkit-version-7-0123-with-net-4-5/
    http://sampathnarsingam.blogspot.in/2012/05/how-to-make-ajax-control-toolkit.html
    Please inform me freely if you have any questions.
    Thanks
    Qiao Wei
    TechNet Community Support
    Is it possible to use version AJAX
    Control Toolkit .NET 4.5 along with SharePoint 2013?
    As far as I know with SharePoint we can use only version AjaxControlToolkit(3.0.30930.0). Isnt it?

  • [Forum FAQ] Show Attachments in SharePoint 2013 Custom List View

    Introduction:
    By default, there is an Attachments column in the SharePoint List, some people want to display attachments name and click name can open the documents in List View. In this article, we would show you the method with
    REST API, JSLink and jQuery.
    Solution:
    The steps in detail as follows:
    Download the jQuery API  and upload the js file into the
    SiteAssets Document Library.
    Save the following code as a js file (showAttachments.js) and upload it into the
    SiteAssets Document Library.
    (function () {
    // Create object that have the context information about the field that we want to change it output render
    var attachmentsFiledContext = {};
    attachmentsFiledContext.Templates = {};
    attachmentsFiledContext.Templates.Fields = {
    "Attachments": { "View": AttachmentsFiledTemplate }
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(attachmentsFiledContext);
    // This function provides the rendering logic for list view
    function AttachmentsFiledTemplate(ctx) {
    var itemId = ctx.CurrentItem.ID;
    var listName = ctx.ListTitle;
    return getAttachments(listName, itemId);
    //get attachments field properties
    function getAttachments(listName,itemId) {
    var url = _spPageContextInfo.webAbsoluteUrl;
    var requestUri = url + "/_api/web/lists/getbytitle('" + listName + "')/items(" + itemId + ")/AttachmentFiles";
    var str = "";
    // execute AJAX request
    $.ajax({
    url: requestUri,
    type: "GET",
    headers: { "ACCEPT": "application/json;odata=verbose" },
    async: false,
    success: function (data) {
    for (var i = 0; i < data.d.results.length; i++) {
    str += "<a href='" + data.d.results[i].ServerRelativeUrl + "'>" + data.d.results[i].FileName + "</a>";
    if (i != data.d.results.length - 1) {
    str += "<br/>";
    error: function (err) {
    //alert(err);
    return str;
    3.     Edit the list view page.
    4.
    Edit the list web part. Go to Miscellaneous -> JS Link.
    5.    Add the following URL into the JS Link textbox.
    ~site/SiteAssets/jquery-1.11.1.min.js|~site/SiteAssets/showAttachments.js
    Result:<o:p></o:p>
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Hi,
    Thanks for your details steps, with your steps I can reproduce the issue using SharePoint server 2013 without any CU or PU.
    The items not displayed when group by the calculated column.
    However, I had done more research and test, I had found that it’s a known issue.
    I had tested with the SharePoint server 2013 which applied the December CU, the issue disappeared, the items displayed well.
    You can install the December CU for SharePoint server 2013, then test whether it works.
    http://blogs.technet.com/b/stefan_gossner/archive/2013/12/20/december-2013-cu-for-sharepoint-2013-has-been-released.aspx
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Pulling user/group field data from SharePoint list using REST, jQuery, Knockout.js Sharepoint 2013

    I'm trying to make an interactive task board based on the task list app in SharePoint 2013. The task lisk includes fields like "Title","Description","Status","% Complete","Due Date","Assigned To",
    etc. I used knockout.js to bind "Title","Description", and "Status" to my HTML controls. Here is some of the code:
    var ViewModal = function(items, listname){
    var self = this;
    self.sortBy = ko.observableArray(sortBy);
    self.tasks = ko.observableArray(items);
    self.listname = ko.observable(listname);
    self.auto = ko.observable(false);
    self.getTasks = function() {
    clearTimeout(self.getTasks);
    // server relative url to REST service endpoint
    var ajaxurl = _spPageContextInfo.webServerRelativeUrl + "/_vti_bin/listdata.svc/" + self.listname() + "?$orderby=PriorityValue";
    $.ajax({
    type: "GET",
    url: ajaxurl,
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    cache: false,
    processData: true,
    success: function (data, status, xhr) {
    if (status == "success" && data) {
    ko.mapping.fromJS(data.d.results, mapping, self.tasks)
    $(".task-item").draggable();
    error: alert
    if (self.auto()) {
    setTimeout(self.getTasks, 10000);
    <div class="tasks-column">
    <div class="column-header">Not Started</div>
    <!-- ko foreach: tasksNotStarted -->
    <div class="task-item">
    <div class="view" data-bind="visible: !IsEditing()">
    <button class="edit" data-bind="click: $root.editTask">edit</button>
    <h2><span data-bind="text: Title"></span></h2>
    <div data-bind="html: Description"></div>
    <span data-bind="text: PriorityValue"></span>
    </div>
    <div class="edit" data-bind="visible: IsEditing">
    <button class="save" data-bind="click: $root.saveTask">save</button>
    <input type="text" data-bind="value: Title"></input>
    </div>
    </div>
    I'm having trouble displaying the data from the "Assigned To" user/group field. I tried:
    <span data-bind="text: AssignedTo"></span>
    But it displays the field as [object Object]
    I tried using $select/$expand
    ?$select=Title,AssignedTo/Id,Assignedto/Title&$expand=AssignedTo/Id,AssignedTo/T‌​itle";
    But it still returns the [object Object]

    Hi,
    Please use the REST URI below:
    /_api/lists/getbytitle('ListName')/items?$select=Title,AssignedTo/ID,AssignedTo/Title&$expand=AssignedTo/ID,AssignedTo/Title
    More information for your reference:
    How to get User Details and User Group Details in SharePoint 2013 REST API with Knockout for SharePoint Js (KoSpJs)
    http://www.ashokraja.me/post/How-to-get-User-Details-and-User-Group-Details-in-SharePoint-2013-REST-API-with-Knockout-for-SharePoint-Js-(KoSpJs).aspx
    How to Get Login Name and Display Name using SharePoint 2013 REST API
    https://www.nothingbutsharepoint.com/sites/devwiki/articles/pages/how-to-get-login-name-and-display-name-using-sharepoint-2013-rest-api.aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Unable to save lookup field data in SharePoint 2013 online list

    Dear Support,
    I had successfully created provider hosted app and deployed on SharePoint 2013 online site, in my project I created orderservice.asmx.cs web service and write a code for save record on SharePoint
    2013 online list as I mentioned below and calling on App1.js file.
    But I am unable to save lookup field value as mentioned below code
    Customer is a lookup field I want to save data in SharePoint 2013 online list( Order)where I had successfully
    inserted text field  data (Title &
    Special_x0020_Instruction).
    i am getting error as mentioned below
    500 Internal Server Error {"Message":"Invalid web service call, missing value for parameter: \u0027Title1\u0027.","StackTrace":"   at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary`2
    parameters)\r\n   at System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary`2 parameters)\r\n   at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData,
    IDictionary`2 rawParams)\r\n   at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}
    Please let me know the code how to insert lookup field value (Customer)
    in SharePoint online list.
    OrderService.asmx.cs
    Public
    int InsertOrder (Order
    orderRecord)
                pwd.MakeReadOnly();
                clientContext.Credentials =
    new
    SharePointOnlineCredentials (myUserName, pwd);
    try
                  Web
    oWeb = clientContext.Web;
    ListCollection lists = oWeb.Lists;
    List oOrderlist = clientContext.Web.Lists.GetByTitle("Order");
                    clientContext.Load<ListCollection>(lists);
                    clientContext.Load<List>(oOrderlist);
                    ListItemCreationInformation
    itemCreateInfo = new                 ListItemCreationInformation();
    ListItem oListItem = oOrderlist.AddItem(itemCreateInfo);
                    oListItem["Title"]
    = Title;                        listItem["Special_x0020_Instruction"]
    = orderRecord.Instruction;
                        listItem ["Customer"]
    = orderRecord.CustomerId;
                        listItem.Update();
                        clientContext.ExecuteQuery();
    return 1;
    catch
    return -1;
    App1.JS
    $("#Save").click(function
    debugger;
    var OrderProfile = $('#orderprofile').val();
    var CustomerId = $('#exCustomerlist').jqxComboBox('getItem',
    $('#exCustomerlist').val());
    //var Instruction = $('#instruction').val();
            alert(OrderProfile);
            alert(CustomerId);
    var obj = {
    'Title': OrderProfile,
    'Customer': CustomerId }
            $.ajax({
                url:
    "OrderService.asmx/InsertOrder",
                type:
    "POST",
                dataType:
    "json",
                data: JSON.stringify(obj),
                contentType:
    "application/json; charset=utf-8",
                beforeSend:
    function (XMLHttpRequest) {
    //Specifying this header ensures that the results will be returned as JSON.
                    XMLHttpRequest.setRequestHeader("Accept",
    "application/json");
                success:
    function (response) {
                    $(".errMsg ul").remove();
    var myObject = response.d;
                    alert(myObject);
                error:
    function (response) {
                    alert(response.status +
    ' ' + response.statusText +
    ' ' + response.responseText);
    Regards,
    Akhilesh

    Hi Alex Brassington,
    Thanks for your reply.
    I am having the Site Administrator Permission of the public site.
    I am having the permission of Company Administrator of that site but still unable to find
    Device Channel on Site Setting. still I gave the user full control from Site Permission but nothing is happening.
    What should I do next?

  • Sharepoint 2013 Setting people picker with Jquery not working in IE8

    In a SharePoint 2013 list with a people picker column labeled Name the following code works great in IE9 and IE10, however in IE8 the script shows an undefined is null or not an object error message at spPeoplePicker.AddUnresolvedUserFromEditor(true);
    FYI using jquery min 1.10.2
    Any ideas on how to resolve the issue?
    <script type="text/javascript">
    $(document).ready(function () {
    var userid = _spPageContextInfo.userId;
    //alert(userid)
    function GetCurrentUser() {
    var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")";
    var requestHeaders = { "accept" : "application/json;odata=verbose" };
    $.ajax({
    url : requestUri,
    contentType : "application/json;odata=verbose",
    headers : requestHeaders,
    success : onSuccess,
    error : onError
    function onSuccess(data, request){
    var userName = data.d.Title;
    //set following "field" as column to set in people picker
    SetUserFieldValue("Name",userName);
    function onError(error) {
    //alert(error);
    function SetUserFieldValue(fieldName, userName) {
    var controlName = fieldName;
    var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
    var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");
    var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
    //comment out this field if edit form needs to be read only
    peoplePickerEditor.val(userName);
    //comment out this field if edit form needs to be read only
    spPeoplePicker.AddUnresolvedUserFromEditor(true);
    //disable the field
    spPeoplePicker.SetEnabledState(false);
    //hide the delete/remove use image from the people picker
    $('.sp-peoplepicker-delImage').css('display','none');
    GetCurrentUser();
    </script>

    Hi David,
    Below is the complete code I have used to load the current user to the people picker in SharePoint 2013.
    $(document).ready(function(){
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', LoadCurrentUser);
    function LoadCurrentUser() {
    var context = SP.ClientContext.get_current();
    var siteColl = context.get_site();
    var web = siteColl.get_rootWeb();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.executeQueryAsync(Function.createDelegate(this, SetPickersToCurrentUser), Function.createDelegate(this, LoadUserfailed));
    function LoadUserfailed() {
    alert('failed');
    function SetPickersToCurrentUser()
    var loginName = this._currentUser.get_title();
    SetPeoplePicker('Order Team', loginName);
    function SetPeoplePicker(fieldName, userAccountName) {
    var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + fieldName + "']");
    var peoplePickerEditor = peoplePickerDiv.find("[title='" + fieldName + "']");
    var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
    peoplePickerEditor.val(userAccountName);
    spPeoplePicker.AddUnresolvedUserFromEditor(true);
    Let me know if you have any questions. I will help you out!
    -Praveen.
    ASP.NET and SharePoint developer
    Blog: http://praveenbattula.blogspot.com
    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you.

  • Adding a Left Navigation in the place of Current navigation in SharePoint 2013 Site.

    Hi All,
    I have successfully converted an HTML Page to a SharePoint 2013 Master Page. I also created a Custom Page Layout. Using both them I have created my SharePoint Site with 30+ pages. Each page is consisted with the Top Header Navigation as it is inheriting
    from the Master Page I have used. Now I need the left navigation inherit from the master page also. It gives me the advantage of updating it from the master page and affects it through the entire SharePoint Site. 
    But at the moment I am inserting the Left Nav using a web part as an HTMl code snippet individually for each and every page. If needs a modification I have to go through all the pages and do the modification. This is not convenient also. I want to this left
    nav like the SharePoint Current Navigation alternative but within my Page Layout.
    Is there an option to chat within these forums?
    Could someone help me to solve this problem?
    Thanks and regards,
    Chiranthaka

    Hi Chiranthaka,
    Thank you for posting in MSDN forum.
    Since
    this forum is to discuss: Visual
    Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.
    Based on your issue,
    it is more related to the sharepoint, so I’m afraid that
    it is not the correct forum for this issue.
    In addition, I find that you have been posted this issue in this SharePoint forum:
    https://social.msdn.microsoft.com/Forums/en-US/7e3af32b-2bf8-41f5-9420-9265ed64458c/adding-a-left-navigation-in-the-place-of-current-navigation-in-sharepoint-2013-site?forum=sharepointgeneral ,
    so we will merge this case to the above case, I think that the SharePoint expert will follow up your issue.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to work JQuery and content editor webpart functionality in sharepoint 2013?

    Hi all,
    I have a requirement to display the list data in share-point page by using JQuery and content editor web-part. could you please any one suggest the process to display the list data using JQuery and ContentEditorWebpart.
    Thanks in advance.
    Thanks,
    phani kumar
    Phani kumar

    Hi,
    From your description, my understanding is that you want to show a list data in a page using jQuery and Content Query Web Part.
    You could use SharePoint REST API to accomplish your requirement, please refer to this code below:
    <div id="listData">
    </div>
    <script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script><script type="text/javascript">
    $(document).ready(function(){
    //replace your list title
    $.ajax({
    url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('customlist03')/items",
    type: "GET",
    headers: {"accept": "application/json;odata=verbose"},
    success: function (data) {
    if (data.d.results) {
    var obj = data.d.results;
    for(var i = 0; i < obj.length; i++)
    $("#listData").append("<div>title "+obj[i].Title+"</div>");
    error: function (xhr) {
    alert(xhr.status + ': ' + xhr.statusText);
    </script>​​
    The screenshot below is my result:
    Please refer to these articles:
    Working with lists and list items with REST
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx
    SharePoint 2013 – CRUD on List Items Using REST Services & jQuery
    http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/
    You can also get list data using JavaScript Client Object Model(JSOM), you could refer to this article:
    How to: Complete basic operations using JavaScript library code in SharePoint 2013
    https://msdn.microsoft.com/en-us/library/office/jj163201.aspx?f=255&MSPPError=-2147217396
    Here is a link about how to add code into page via Content Editor Web Part:
    http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Asynchronous visual webpart for SharePoint 2013

    HI,
    How to create asynchronous visual webparts in SharePoint 2013 (VS 2012) . I can see lot of examples for 2010 version, but not for SP 2013.
    I have 2 visual webparts, which I want to make it as a asynchronous webpart. One webpart has the code written in Javascript client object model(loads lot of images), another is a server side webpart which has a SPGridview.
    Is there any sample code available for SP 2013?
    Thanks

    Hi,
    Please try to convert the SharePoint 2010 project to SharePoint 2013.
    http://sadomovalex.blogspot.kr/2013/02/convert-visual-studio-sharepoint-2010.html
    In SharePoint 2013, we can create a visual web part, then we can use jQuery Ajax and REST API to achieve asynchronous data loading.
    More information:
    http://www.dotnetcurry.com/showarticle.aspx?ID=1009
    http://asyncwebpartframewrk.codeplex.com/releases/view/52459
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

Maybe you are looking for

  • How can I upgrade my iBook G4?

    I have an old iBook G4 with Mac OS X 10.2.8 ... what do I need to download to bring it the most current I can? And how can I upgrade to the latest OS version (whatever it is)? I would prefer to download as many of the free updates as I can, before I

  • Help menus not working for CS5 Production Premium

    I have installed the trial version of CS5 Production Premium on a Windows 7 64-bit PC. I canot get the Help menus to work for any of the applications. Is this a limitation of the CS5 trial version? I recently purchased Premiere Elements, but I did no

  • Keep getting error message (-70) while trying to download Illustrator. Please advise.

    Thanks.

  • Apache log analysis for portal page visits etc

    We are about to go into production with Oracle Portal (9iAS rel 9.0.2.0.1). I have been looking into how to gather statistics on web site usage and have concluded that I cannot get the information from within portal logs since many pages are served f

  • B/W Images on client

    Post Author: ziofat CA Forum: General Hi forum's navigators! I have a little problem on my Crystal Report 8: I insert a JPG or BMP image in the report without problems, but when I print th report from the client the image has no color, it seems that