Interview Questions administrator

Best SharePoint administrator Interview Questions and Answers with topic wise:


Recycle Bin | MMS | ManagedVsCrawledProperties |

Tuesday, June 26, 2012

Feature Receivers in SharePoint 2007/2010/2013

When used it:
The Feature Receivers can be used If you want to perform any action programmatically using C# code like when feature is installed, uninstalled, activated or deactivated.
e.g. I will share one of my best experience about on feature receivers when it’s most required.
Task: I want to develop one custom master page and set that master page as default master page to the site.
Sol: Below are my development approaches on it.
  1. First created a custom master page using existing master page through SharePoint designer.
  2. Deployed that custom master page to the master page gallery using “Feature”.
  3. Finally, write c# code to set our masterpage as default master to the site using “feature receiver”[means I wrote c# code to set our custom master page as default master page inside of “FeatureActivated” event]. Here the feature receiver will run whenever the feature is activated.

Feature’s Scope levels:
SharePoint Features can be targeted at the Farm, Web Application, Site Collection or Web Site scope. The target will effect things like where you can manage the feature activation from in the UI and at which point (and how many times) the Feature receiver events are called.

Scope
Activate/Deactivate Features (2007)
Web Site
Site Actions > Site Settings > Site Administration > Site features
Site Collection
Site Actions > Site Settings > Site Collection Administration > Site collection features
Web Application
SharePoint Central Admin > Application Management > SharePoint Web Application Management > Manage Web application features
Farm
SharePoint Central Admin > Operations > Global Configuration > Manage farm features

Some remember points on Feature Receivers:

How to debug Feature Receiver:

Best method to write feature receiver:

My Best References:


No comments:

Post a Comment