Solved

How to get GUID of current page?

Posted on 2012-03-21
2
495 Views
Last Modified: 2012-03-21
Hello. Is it possible to get GUID of current page? I would like to store it to list to identify data. Something like SPContext.Current.ItemId.
0
Comment
Question by:tolppa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
ivan_vagunin earned 500 total points
ID: 37748406
Hi!
Try:
SPFile file = SPContext.Current.Web.GetFile(HttpContext.Current.Request.Url.AbsoluteUri);
Guid pageId = file.UniqueId;

Note, that this will not work for application pages (inside /_layouts/). Consider using page url instead of guid, because page url is unique and can be used for pages of all types.
0
 
LVL 1

Author Closing Comment

by:tolppa
ID: 37749232
Thanks.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question