Getting The Page Object
using EPiServer.ServiceLocation; var pageRouteHelper = ServiceLocator.Current.GetInstance< EPiServer.Web.Routing.PageRouteHelper>(); var currentPage = pageRouteHelper.Page;Getting A Page Reference
using EPiServer.ServiceLocation; var pageRouteHelper = ServiceLocator.Current.GetInstance< EPiServer.Web.Routing.PageRouteHelper>(); var pageReference = pageRouteHelper.PageLink;you can also use the following code in the block or pagetype to achieve the above
var pageRouteHelper = ServiceLocator.Current.GetInstance();
/Adnan
0 comments :
Post a Comment