How To Use Visual Studio To Create Costum Master Page 1

SharePoint 2013 Hosting – HostForLIFE.eu :: How To Use Visual Studio To Create Costum Master Page

In this post we will tell you how to use Visual Studio 2013 to create custom master page in SharePoint 2013. Here, I’m using Visual Studio 2013 and SharePoint 2013 on premise for this demo. Before doing anything, go to your site settings page and then click on “Master pages and page layouts” which is under “Web Designer Galleries”. From the master page gallery, download seattle.master page as save it in your local drive. In this example, I’m using seattle.master as the base.

Step 1

Now, Open Visual Studio 2013, then File -> New -> Project. Then in the New Project dialog box, From the templates select Visual C# -> Office/SharePoint -> SharePoint Solutions. Then from the right side select SharePoint 2013 – Empty Project. Give a name and click on OK as shown in below:

How To Use Visual Studio To Create Costum Master Page 1

Step 2

Then give your local site for deployment and then choose “Deploy as a farm solution” as shown in the fig below:

How To Use Visual Studio To Create Costum Master Page 2

Step 3

Then right click on the project, then add new item. Then in the Add New Item dialog box, select Module as shown in the fig. Give a name and click on OK as shown in below:

How To Use Visual Studio To Create Costum Master Page 3

Step 4

Then delete the sample.txt from the Module folder and then past the master page which we have downloaded from the site and saved in the local drive. In my case I have given the name as “MyCustomMaster.master”. Now change the Elements.xml like below:

Step 5

Then give a meaningful name to the feature, in my case I have given the name as “ActivateCustomMasterPage”. Then open the feature and give a title and select the scope as Site as shown in below:

How To Use Visual Studio To Create Costum Master Page 4

Step 6

We will add an event receiver which will set our master page when feature got activated and will set to seattle master page when feature get deactivated. Right click on Feature then click on “Add Event Receiver” as shown in below:

How To Use Visual Studio To Create Costum Master Page 5

Step 7

Here we need to write the code ActivateCustomMasterPageEventReceiver. Write below code in the FeatureActivated event:

Step 8

Write the below code in the FeatureDeactivating event:

Step 9

Right click on the solution explorer and then Build solution. If build succeeded then Right click and then Deploy solution. Once the solution got deployed successfully in the site collection, you can go the site collection features to see our feature must be activated. Go to site settings page, then click on “Site collection features” which is under “Site Collection Administration”. In the Site Collection Features page, you will be able to see “Activate Custom Master Page” feature status is Active like below:

How To Use Visual Studio To Create Costum Master Page 6

Step 10

Now to verify if the custom master page is deployed to the site, go to the site settings page then click on “Master pages and page layouts” which is under “Web Designer Galleries”. Here you will be able to see master page under “Master Page Gallery” like below:

How To Use Visual Studio To Create Costum Master Page 7

Now we can go to the settings and see if our custom master page is selected or not. Go to the site settings page, then click on Master page under Look and Feel. To see this link make sure you have publishing feature activated in the site collection. You can also check out: Enable and Disable SharePoint 2013 publishing feature using PowerShell. Here once you click on Master Page, then in the Site Master Page Settings you will be able to see our custom master page is set in the “Site Master Page” as well as “System Master Page” as shown in below:

 

How To Use Visual Studio To Create Costum Master Page 8

Step 11

Now to check whether our feature deactivating is working fine or now. Go to the site collection feature page and deactivate the “Activate Custom Master Page” feature. Once it is successfully deactivated, go to the Master Page link under Look and Feel and you will be able to see the Seattle master page is set in the Site master page as well as settings master page.

How To Use Visual Studio To Create Costum Master Page 9

Over all if you will see your solution explorer, it will look like below:

How To Use Visual Studio To Create Costum Master Page 10

Hope this will be helpful.

SharePoint 2013 Hosting Recommendation

HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/month, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint plans as well as dedicated SharePoint options

hostforlife banner

SharePoint 2013 Hosting Portugal – HostForLIFE.eu :: How To Resolve E-mail Notification Issue

In this post we will discuss how to resolve automated Email Notification issue. Usually this issue will comes out with 2 symptoms: Unable to receive automated Email Notification + (Send e-mail when ownership is assigned) not working and Unable to receive E-mail Notification from SharePoint. This issue is because of “Immediate Alert” timer job which was not working probably.

SharePoint-2013-Hosting1

Solution: Clear The Configuration Cache

To clear the config cache on the farm, follow these steps:

1. Stop the OWSTIMER service on ALL of the MOSS servers in the farm.

2. On the Index server, navigate to:

  • Server 2003 location:
    Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID and delete all the XML files from the directory.
  • Server 2008 location:
    Drive:\ProgramData\Microsoft\SharePoint\Config\GUID and delete all the XML files from the directory.

3. Delete all the XML file in the directory. NOTE: ONLY THE XML FILES, NOT THE .INI FILE.

4. Open the cache.ini with Notepad and reset the number to 1. Then, save and close the file.

5. Start the OWSTIMER service on the Index server and wait for XML files to begin to reappear in the directory.

6. After you see XML files appearing on the Index server, repeat steps 2, 3 & 4 on each query server, waiting for XML files to appear before moving to subsequent servers.

7. After all of the query servers have all been cleared and new .xml files have been generated, proceed to the WFE and Application servers in the farm, following steps 2, 3, 4 and 5 for each remaining server.

SharePoint 2013 Hosting Recommendation

HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/month, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint plans as well as dedicated SharePoint options.

hostforlife banner

 

 

Sharepoint installation

SharePoint 2016 Hosting Spain – HostForLIFE.eu :: How To Solve SharePoint 2016 Error Installation

In this post we will discuss how to resolve “Configuration Failed Error” while installing SharePoint 2016. This error usually comes when you run your SharePoint product configuration wizard and after giving your database details. This error also comes if you are trying to run create configuration database by using SharePoint 2015 Management Shell.

SharePoint-2013-Hosting1The Error

The error comes when we tried to run the New-SPConfigurationDatbase command from the Management Shell. The full command was like this:

New-SPConfigurationDatabase –DatabaseName SharePoint_Config –DatabaseServer WIN-JC2B1V15KM5 –AdministrationContentDatabaseName SharePoint_Content –Passphrase (ConvertTo-SecureString [email protected] –AsPlaintext –Force) –FarmCredentials (Get-Credential) -localserverrole SingleServerFarm

And the error came as like below:

Sharepoint installation

The Solution

The account which we were using does have proper permission, so it was not able to create the configuration database. The below permission is required to create configuration database:

  • Dbcreator
  • SecurityAdmin
  • SysAdmin

When we gave proper permission and then try to re-run the PowerShell command, it runs successfully and also when we run the product and configuration wizard, we would not get the issue.

SharePoint Hosting Recommendation

HostForLIFE.eu’s SharePoint Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/month, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint plans as well as dedicated SharePoint options.

hostforlife banner