SharePoint 2013 Inserts a WebPart in a master page

Source: Internet
Author: User

Recently QQ Group has a friend asked, how to insert their own development of WebPart in the master page. In fact, the master page is not allowed to insert WebPartZone, but the designer can insert a WebPart, or it can be manually registered, and then inserted into a WebPart, but when the designer is inserted, it is automatically registered in the head.

First we develop a test WebPart, the code is simple, just enter a paragraph of text, and then deploy to the site, such as:

For example, I want to modify PageTitle, a WebPart that is customized for us, such as:

In the following position, insert our webpart (I am F12 on the page to find an ID called PageTitle, and then determine that the node is the location), such as:

Do not delete the following node (delete the ContentPlaceHolder node will be error!) ), but cut to the bottom and set the visible to false, such as:

Place the mouse cursor where you want to insert it, and click a WebPart on the menu, such as:

Choose the WebPart that we just developed for testing, such as:

After inserting a WebPart, for example, it has part registration information, the following location has a reference to the part, and if you do not have to insert a WebPart UI, you can register and insert a WebPart manually;

Of course, the location of the insertion, there may not be the position of the cursor, I am accustomed to cut over, easy to use; remember not to interrupt any existing tags, or will error;

Reopen the page and find that the title has not changed, but the tab above has changed, (⊙﹏⊙) b!

Originally I changed the wrong position, if you want to add webpart to the corresponding location, you must remember to find the right location Oh!!

Total Knot

Add a WebPart to a SharePoint master page that's basically the way it is, is it simple?! Some people will ask, if you need to edit what to do, my suggestion is to go to a sitepage page to add WebPart, edit, and then the code copied over, there is a need, you can try, remember not to copy WebPartZone, otherwise error!

SharePoint 2013 Inserts a WebPart in a master page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.