Showing posts with label SharePoint2013. Show all posts
Showing posts with label SharePoint2013. Show all posts

Sunday, November 29, 2015

Bundling and Minification - SharePoint best practice

Found this really helpful article about bundling and minification using visual studio extension:


https://msdn.microsoft.com/en-in/library/dn850363.aspx

SharePoint script on demand

This is very old now and exists in market from long time for SharePoint, So thought of summarizing it once.

1.     Create file with name ShareTechPoint.js and below content

function sayHello() {
  alert("Hello");
}
//Notify SharePoint that the custom file has loaded.
SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs("ShareTechPoint.js ");


2.     Now write the below code in another  HTML/ascx/aspx file

<script type="text/ecmascript">
 
    function runCode() {
        SP.SOD.RegisterSod(‘ShareTechPoint.js ', 
                            '/StyleLibrary/ShareTechPoint.js');
        var x = ExecuteOrDelayUntilScriptLoaded(sayHello, 
                              "ShareTechPoint.js ");
    }
 
</script>
 
<input id="Button1" type="button" value="Run Code" 
onclick="runCode()" />


 


This is how you can implement Script on demand for SharePoint.

References
  • http://www.ilovesharepoint.com/2010/08/sharepoint-scripts-on-demand-spsod.html
  • http://www.kalmstrom.com/Tips/SPDevDynamicLoading.html

Client web part / App Part showing the blank iframe on page

Hello all - While creating first hello client web part many times people face this issue that there cleint web part show blank window after adding on page.

For showing content on page need to allow framing on page as client web parts loan in iFrame.


<WebPartPages:AllowFraming runat="server" />


Check for above line of code on client web part file. If not preset add it there.

Wednesday, November 18, 2015

Download all Site collection documents / Files using Powershell in specific folder

I updated the script written by "Nico Martens" in below blog post

http://sharepointrelated.com/2014/11/11/download-all-content-in-a-site-collection/

Below script will download all your documents in specific folder of Site and List

Sunday, September 6, 2015

Friday, July 31, 2015

Sign in as different user in SharePoint 2013

By default in SharePoint 2013 we don't get option to sign as different user. If you want to get the same 'Sign in as different user' which was there in SharePoint 2010.



Please follow below steps to add it to SharePoint 2013.


1. Go to Control Templates folder

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES


2. Edit Welcome.ascx




3. Add below code lines at second place of MenuItemTemplate

<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"  
   Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"  
   Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"  
   MenuGroupId="100"  
   Sequence="100"  
   UseShortId="true"  
/>




4. Now go to SharePoint site and refresh the page.






Simple!!!!!!!


Tuesday, August 26, 2014

Step by step - Enable Form based authentication in SharePoint 2010 or SharePoint 2013 (step by step FBA / Claims based authentication)

Finally done :)

I was planning to implement and write a article with screen shots about claims from long time.


Follow below steps to enable Form based authentication in SharePoint 2010 or SharePoint 2013.



Sunday, February 17, 2013

Adding webpart Propert using editor part and fetching list item title with styling


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.WebControls;

using Microsoft.SharePoint;

using ZS.CodeChallenge.V1.common;

using System.Web;

using Microsoft.SharePoint.WebPartPages;

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item. There was no erro...