How can I get the Page Type for the current page. I tried
CurrentPage.GetType();
but no success. I need to check if the Page Type equals a specific type in order to do something or not.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to check the
PageTypeNameorPageTypeIDproperties, like this:Check the reference: http://sdk.episerver.com/library/cms5/html/AllMembers_T_EPiServer_Core_PageData.htm
The
GetType()method is declared onSystem.Objectand returns theSystem.Typefor the object. Is is available on all types in the .NET Framework since all types inherit fromSystem.Object.