Sunday, September 28, 2014

How to open PDF document files in a new browser tab in SharePoint

Open PDF Files in a New Browser Tab
By default SharePoint PDF files opens in current window and end user feeling that he came out of SharePoint navigation. So clients are asking they want to open PDF files in a new tab instead of the current window. 

Over the net there are so many users telling that use content editor web part with javascript to open the PDF file in new window but it would be very difficult to add each document library and each page. So i tried in another way that is if i can add the javascript on master page then it will be applied to each and every page on SharePoint so that i can solve the problem then i tried and applied.
Everything is working perfect and clients are happy :).

Step 1: Download the latest version of jQuery (I used version 1.7.2 for this example)
Step 2: Upload the jQuery file to a document library within the site collection
Step 3: Make sure all users have read access to the document library
Step 4: Add the following code with your Master Page’s body tag
<script src="/Style library/javascript/jquery-1.7.2.min.js"type="text/javascript">

Save and publish your master page.

Saturday, September 6, 2014

Issue: Missing "Apps you can add" in SharePoint 2013

I have created new master page using html everything working as expected and deployed on production. But after some time user found that they are not able to add custom apps on SharePoint portal.

After searching on this we game to know that we missed two important tags in the master page.

<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server" />

if preview giving any error like 'asp' is not valid or something then add as below

   <!--MS:<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server">-->

NOTE: Some times you might commented this code by mistake without knowing.

I have added these two tags back to the master page then "Apps you can add" section came back.

Tuesday, September 2, 2014

Upgrading a SharePoint 2010 custom solution to SharePoint 2013

Recently i have been working with SharePoint 2010 to 2013 migration project on development server and when i was trying to migrate i got one problem.

I have SharePoint 2010 custom code solution file and i opened that solution using visual studio 2012 and it automatically converted the solution to SharePoint 2013 version.

And also i have changed user control path in .webpart file and deployed the solution.

Now i tried to add the web part to my page but it is throwing error.

then i checked the log files it was showing could not find the user control file.

Then i have checked the user control under 15, it was not there but it was there under 14 hive.

Then i realised that the solution has been deploying under 14 from visual studio.


Solution for the problem is, The first thing you need to do is change your 'SharePoint Product Version' to "15.0". Doing this causes your solution to be treated as a SharePoint 2013 solution and will deploy all of the components to the correct locations.