Sharepoint Pages (2)

Build Application Page with VS 2010

Create an empty Sharepoint project, farm solution, called CustomApplicationPage,add an Application Page item, Custom.aspx.

Master page link —

Add 6 labels in the Main area:


AGAIN, According to SharePoint best practices, SPSite and SPWeb objects returned by SPContext.Site, SPContext.Current.Site, SPContext.Web, and SPContext.Current.Web should not be explicitly disposed by user code.


Set the page as startup page during debug. Click the project and change Startup item.

You need to know the physical path of your application page so you can try it in web browser:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\CustomApplicationPage


(in the URL, “layout” has an underscore in front)

How to restrict access to the page?

(1) Using permission Levels.

* Sharepoin thas 5 permission levels
defined out-of-box.
a. Limited Access, b. Read, c. Contribute, d. Design, e. Full Control.

Update the code so we only allow user who has FULL Control
permission to see it.

(2) Check for Group – looks easier

By deafult there are 3 groups – a. Owners, b. Members., c. Visitors

(3) Only allow site collection administrator to access. We can do this by overriding the property RequireSiteAdministrator and return true.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: