Wednesday, April 15, 2009

Writing Application pages for Site Administrator

Scenario:
This is very common requirement where we need extra Admin User Interfaces to handle different application configurations but also want to make sure that only Site Admin can access it.

You can create a new Custom Application page inheriting LayoutsPageBase

Solution:
You can override RequireSiteAdministrator property of LayoutsPageBase class
Code:



public class ApplicationSpecificPage : LayoutsPageBase {

protected override bool RequireSiteAdministrator {
get { return true;}
}

protected override void OnLoad(EventArgs e) {
// Do Something
}

0 comments: