Tag Archives: Cheap Hosting

SharePoint 2013 Hosting :: Duplicate Web Part Issue in SharePoint 2013

Today for something regarding one of the new features of SharePoint 13. There is the new attribute “ReplaceContent=TRUE” for the <File> element in <Module>.

Until SharePoint 2010, whenever we reactivate the PageLayout feature (the feature that provisions the page layouts in a master page gallery), web parts that have been added to the page layout are duplicated on the new page and we do not have a very standard solution to resolve this problem except for writing a feature receiver and removing the duplicated web parts.

ahp banner sharepoint-01
In SharePoint 2013 is the new attribute “ReplaceContent=TRUE” of the <File> element and if we use this when provisioning the page layout it overrides the existing web parts on the page layouts. So whenever we create a new page from the given page layouts, web parts are not duplicated.

    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
      <Module Name="MyPageLayouts" Url="_catalogs/masterpage" RootWebOnly="TRUE">  
        <File Path="MyPageLayouts\MyPageLayout.aspx" Url="MyPageLayouts.Intranet/MyPageLayout.aspx" Type="GhostableInLibrary" ReplaceContent="TRUE">       
    <!—- All our web parts goes here -->  
        </File>  
      </Module>

Have a look at the preceding example, I have set the ReplaceContent=”TRUE”. Because of this whenever I change, add or delete a web part in this elements.xml file and I need to reactivate the feature, the web parts on the page layouts are not duplicated but they do get overridden.

Other Usage example

I’ll like to share one more scenario related to this, I have a sandbox solution that I am deploying on Office 365. I was uploading my package file (.wsp) to the Solution Gallery and activating it. In my package I have one feature that is deploying my CSS file in the master page gallery since I do not have file system access. I had a change in CSS file, I did the change, packaged the solution, deactivated the solution first, uploaded it to the solution gallery and activated it. But my CSS changes are not reflected. Then I remembered the “ReplaceContent” attribute and I used it in the module element while provisioning the CSS file and wonder happened? It worked like a charm.

Feel free if you have some thoughts on this or please share your experience. Thanks :)

Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

 

 

SharePoint 2013 Hosting :: How To Retrieve Followed Sites in SharePoint 2013 Using REST API

This article explains how to retrieve the site name and URL followed by the current user in SharePoint 2013 using a client object model (REST API and JavaScript)

We can use the SharePoint 2013 Representational State Transfer (REST) service to do the same tasks you can do when you use the .NetCSOM, JSOM.
Here I explain how to retrieve the site name and URL followed by the current user in SharePoint 2013 using a client object model (REST API and JavaScript) and displaying it in the SharePoint page.

  • Create a new page and a Content Editor Webpart (CEWP)

Create a New page

  • Edit the web part that was added to the page.
  • Upload your text file script into the site assests and copy the path of the text file and paste it into the Content link in CEWP.

Code

The following example shows how to retrieve all of the following sites:

<html>    
    <head>    
       <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>    
          <script type="text/javascript">  
             var followingManagerEndpoint;  
             var followedCount; 
             var followingEndpoint;    
             var URL;    
             var website;    
             var clientContext;  
             SP.SOD.executeFunc('sp.js', 'SP.ClientContext', loadWebsite);    
             function loadWebsite() {    
                clientContext = SP.ClientContext.get_current();    
                website = clientContext.get_web();    
                clientContext.load(website);    
                clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed);    
             }    
             function onRequestSucceeded() {   
               URL = website.get_url();    
               followingManagerEndpoint = decodeURIComponent(URL) + "/_api/social.following";   
               getMyFollowedContent();  
            }    
            function onRequestFailed(sender, args) {    
              alert('Error: ' + args.get_message());    
            }   
            // Get the content that the current user is following.  
            // The "types=14" parameter specifies all content types  
            // (documents = 2 + sites = 4 + tags = 8).  
           function getMyFollowedContent() {  
             $.ajax( {  
                  url: followingManagerEndpoint + "/my/followed(types=14)",  
                  headers: {   
                      "accept": "application/json;odata=verbose"  
                  },  
                  success: followedContentRetrieved,  
                  error: requestFailed  
            });  
         }  
         // Parse the JSON data and iterate through the collection.  
         function followedContentRetrieved(data) {  
             var stringData = JSON.stringify(data);  
             var jsonObject = JSON.parse(stringData);   
             var types = {  
               1: "document",  
               2: "site",  
               3: "tag"   
            };  
            var followedActors = jsonObject.d.Followed.results;   
            var followedList = "You're following items:";  
            for (var i = 0; i < followedActors.length; i++) {  
               var actor = followedActors[i];  
               followedList += "<p>The " + types[actor.ActorType] + ": \"" +actor.Name + "\"</p>"+"<p>Site URL " + ": \"" +  
               actor.Uri+ "\"</p>";;  
            }   
            $("#Follow").html(followedList);   
         }  
         function requestFailed(xhr, ajaxOptions, thrownError) {  
           alert('Error:\n' + xhr.status + '\n' + thrownError + '\n' + xhr.responseText);  
         }  
       </script>    
    </head>    
 <body>    
 <div id="Follow"></div>    
 </body>    
 </html>

Happy Coding :)

Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

SharePoint 2013 Hosting – ASPHostPortal.com :: Including a Blog to an Existing Site (Without Creating a New Site)

Usually when you want a website in SharePoint 2013, you should produce a brand new website assortment or a subsite using the Website site template.

1dfvwsjbefAt times it would just be simpler (or great) to have a weblog correct in yet another web site for instance a team site or departmental website without the require for yet one more site selection or subsite to maintain. No problem.

ahp_freehostSHP

You can easily include a weblog to an present website making use of PowerShell. Fire up the SharePoint 2013 Management Console and enter the subsequent command:

Enable-SPFeature -identity “BlogContent” -url <<the url of the site>>

2ntntjNext, navigate to the site in the browser and edit the home page:

3tbrtntnFrom the Insert tab on the top ribbon, click on Web Part:

4grjrjtySelect Posts from the Apps category and click on the Add button:

5trmjrymThe blog posts now appear on your home page:

6mtymtClick on the sample blog post:

7dfnfnYou now have a blog in your existing site without having a separate subsite!

SharePoint 2013 Hosting with ASPHostPortal.com – How To Migrate Content Database From SharePoint 2010 To SharePoint 2013

Migrate Content Database From SharePoint 2010 To SharePoint 2013

In this article, we will take you through the database migration process from SharePoint 2010 to SharePoint 2013. An overview of the SharePoint database migration process to a new server is available on the ShareGate website.

ahp_freehostSHP

Step-by-step to migrate content database

  • Step 1 : Make two servers available for the process. Both the servers need to run on the same environment. For instance, Server 1 should run on Windows 2008, SQL server 2008 and include SharePoint 2010. Server 2 should run on Windows 2008, SQL server 2008 and include SharePoint 2013.
  • Step 2 : You must begin with backing up the data from Server 1. To do this,

a) While on SharePoint 2010, pick the database of the port you want to back-up. Right click and from the options that appear, click Tasks → Back Up.
b) In the subsequent window that opens, click ‘Add
c) Copy the location available under the ‘Destination’ field and save it a notepad for later use.

  • Step 3 : On server 2, launch SharePoint 2013 and create a new web application under any port. If you are not sure, pick port 88.
  • Step 4 : Once a new application has been created, perform the following steps:

a) Under Central Administration, select Application Management Manage Content Databases
b) Under the newly created web application, select ‘Remove content database checkbox’. Click OK and SAVE
c) Under the Content Database section, you should now see a message that reads, “There are no items to show in this view’

  • Step 5 : The next step is to restore the database from SharePoint 2010 to the new server. To accomplish this, copy the WSS_Content.bak file from Server 1 on to the desktop or any convenient location on the computer handling Server 2.
  • Step 6 : In SharePoint 2013, launch SQL Server 2008 and right click on the node titled Database and from the options, choose ‘Restore Database’.
  • Step 7 : A new ‘Restore Database’ window now opens. Here, select the ‘From Device’ radio button and browse through your system folders to select the WSS_Content.bak file that we had earlier copied in Step 5. Click OK
  • Step 8 : Next, under the ‘Options’ tab of the Restore Database window, check the box that reads, “Overwrite the existing database (WITH REPLACE)”. Press OK to continue. A message box appears that confirms the operation. Press OK to close this box.
  • Step 9 : Open SharePoint 2013 and navigate to Central Administration → Application Management → Manage Content Databases. You should now see the WSS_Content.bak file displayed here.
  • Step 10 : On the top of the window, you will see a message. Click on the ‘Start Now‘ link to continue.
  • Step 11 : In the subsequent window, click on the ‘Upgrade the site collection’ option. You will be shown a message box. Click ‘I’m Ready‘ to continue.
  • Step 12 : The upgradation process will now begin. This typically takes a few minutes. Once you are done, you will be shown a message that reads, “Upgrade Completed Successfully”

This completes the process. Your content database migration from SharePoint 2010 to SharePoint 2013 has been completed successfully.