Bug reports
Version 2.x > Bug reports > mCurrentPage No Longer in 2.1d? View modes: 
User avatar
Certified Developer 8
Certified Developer 8
mayfieldv @bit-wizards.com - 4/20/2007 10:28:06 PM
   
mCurrentPage No Longer in 2.1d?
I just upgraded my project to 2.1d. We have code in an H1Tag that shows the Page Name in the tag like so:
<h1><%=mCurrentPage.DocumentName.ToString()%></h1>

I now get an error of Compiler Error Message: CS0103: The name 'mCurrentPage' does not exist in the current context

Looking up this error it tells me that the variable is no longer in scope. Has it been taken out in this version. If so how can I get the name of the page at runtime.

User avatar
Kentico Developer
Kentico Developer
jaroslavk - 5/8/2007 1:48:54 PM
   
RE:mCurrentPage No Longer in 2.1d?
Hello,

Yes, you are right, this variable is no longer available. It has been taken out because it wasn't intended to be aviable here. Correct way how to get the name of the page is to use CMS.CMSHelper.CMSContext.CurrentPageInfo. We are sorry for this inconvenience.

Best Regards,
Jaroslav Kordula