How to get Title & URL of SharePoint Page via Object Model

In this hint,I elaborates How to get the Title and URL of SharePoint Page using SharePoint Server Object Model as shown below :

using Microsoft.SharePoint;
String Title= SPContext.Current.Item["Title"].ToString(); 
// to get the page title
String URL=System.Web.HttpContext.Current.Request.Path; // to get the page URL
SPContext.Current.Web.Url + "/" + SPContext.Current.File.Url;
// to get the page URL in a different way

Enjoy 🙂

Advertisements

5 thoughts on “How to get Title & URL of SharePoint Page via Object Model

  1. I’ve been surfing online more than three hours as of late, but I by no means found any fascinating article like yours. It’s beautiful
    worth sufficient for me. In my opinion, if all website
    owners and bloggers made just right content material as
    you probably did, the internet shall be a lot more useful than ever before.

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s