Tag Archives: how to sharepoint

Custom Error Page in SharePoint 2013/2010

Open Web.Config file for your web application. For Custom Error – I change in web config tags <SafeMode MaxControls=”200″ CallStack=”false” DirectFileDependencies=”10″ TotalFileDependencies=”250″ AllowPageLevelTrace=”true”> <customErrors mode=”On” /> For Custom Error – II change in web config tags <SafeMode MaxControls=”200″ CallStack=”true” DirectFileDependencies=”10″ … Continue reading

Posted in SharePoint | Tagged , , , , , , , , , | Leave a comment

How to add Favicon Icon on SharePoint Master Page – SharePoint 2013 Site

<head runat=”server”> <!–SPM:<SharePoint:SPShortcutIcon runat=”server” IconUrl=”/_layouts/15/images/favicon.ico?rev=23″/>–> </head>

Posted in SharePoint | Tagged , , , , , , , | Leave a comment

How to get current user id and name in Sharepoint 2013 using Ecma Script

var userid; function GetUserDetails() { clientContext = new SP.ClientContext.get_current(); var oWeb = clientContext.get_web(); currentUser = oWeb.get_currentUser(); clientContext.load(currentUser); clientContext.executeQueryAsync(function () { userid = currentUser.get_id(); usertitle = currentUser.get_title(); }, function (error) { alert(‘Request failed: ‘); }); }

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

How to run ecma script on Page Load – SP Execute or

SP.SOD.executeFunc(“sp.js”, “SP.ClientContext”, FunctionName); function FunctionName(){ }

Posted in SharePoint | Tagged , , , , , , , , | Leave a comment

How to get logged in user image in SharePoint 2013 (MySite)

$.ajax({ url: _spPageContextInfo.webAbsoluteUrl + “/_api/SP.UserProfiles.PeopleManager”+ “/GetMyProperties?$select=PictureUrl,DisplayName,AccountName”, type: “GET”, contentType: “application/json;odata=verbose”, headers: { “accept”: “application/json;odata=verbose” }, async: false, success: function (data) { var pic = data.d.PictureUrl; var member = data.d.DisplayName; if (pic) { $(“#userName”).text(member); $(“#paduserName”).text(member); $(“.imageicon”).attr(“src”,pic.Url); } else { $(“#userName”).text(member); $(“#paduserName”).text(member); … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment