Webpart Inheritance Or Webpart Block

Aasim Khan asked on May 21, 2015 08:00

Hello Team,

I have created one web-part in my template. I want to use same web-part in another template using inheritance. So please let me know how can i do this ?

Thanks, Aasim Afridi

Correct Answer

Charles Matvchuk answered on May 21, 2015 17:20

Web parts do not follow the Parent Child paradigm. Perhaps you mean cloning.

You can clone a webpart and set all of its properties at the web part level and the use the cloned web part anywhere in the system. If you are just putting a web part on a page and setting its properties and then copying the webpart to a different page, the settings are independent although the initial copy will be identical at first. This is by design. To achieve what you want, please clone the web part, set all of the settings in the webpart properties as defaults and then use the webpart through out the system.

0 votesVote for this answer Unmark Correct answer

Recent Answers

Brenden Kehren answered on May 21, 2015 13:13

Webparts can inherit other webparts just like page types can inherit other page types. It's very similar to how a C# class can inherit other classes. Page templates can also have inheritance. So I'm not 100% sure I understand your question. If your webpart is built properly you can use it on as many pages or templates as you wish without any inheritance or issue. So maybe explain what your desired result would be.

0 votesVote for this answer Mark as a Correct answer

Aasim Khan answered on May 21, 2015 16:43

I am giving you one example.If we are creating a webpart(As a Parent) and i want to use this in another template as a child. And if i am changing anything else in parent webpart then child webpart should be automatically updated.


0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.