ASPX templates
Version 5.x > ASPX templates > Document Content null on page opening View modes: 
User avatar
Member
Member
amitjo-datacom.co - 11/24/2010 7:06:37 PM
   
Document Content null on page opening
We are recieving a null pointer exception when trying to access placeholder data using CMSContext.CurrentDocument.DocumentContent["txtIntro"].ToString(). We are calling this method in our OnInit() but it appears that the Document Content doesn't exist at that stage. We tried moving it to PageLoad() but that didn't work either.

What is unusual is that this only started happening yesterday. The same code had been working for years previously. Right now this is issue appears quite random to us and we don't understand why it happens.

Does anyone know what could be causing this?”

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 11/25/2010 3:06:21 AM
   
RE:Document Content null on page opening
Hello,


Could you please try to use:

CMSContext.CurrentPageInfo.EditableItems["editabletextwebpartID"]

Does it work?


Best regards,
Helena Grulichova