ASPX templates
Version 7.x > ASPX templates > How to access custom document type fields from aspx template View modes: 
User avatar
Member
Member
njbraun-gmail - 12/1/2013 2:53:05 AM
   
How to access custom document type fields from aspx template
I've created a custom document type "MyPage" with just a single field, we'll call it "PageTitle".

In CMSDesk, I've created a new page of type "MyPage", and then in the properties tab, I've assigned an aspx template to this page.

What I'd like to do is this: Access the "PageTitle" field from within the aspx template file.

Simply putting inside of it the ascx transformation:

<%# Eval("PageTitle") %>

does nothing. I'm assuming I can't just plop that directly into template page. Is there anyway of getting this working within my .aspx page?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 12/2/2013 6:41:55 AM
   
RE:How to access custom document type fields from aspx template
Hello,

just to be sure, are you talking about the code-behind of the page template file?
Please take a look at the following chapter in Dev Guide: Managing documents where you can find also API examples how to get and modify document properties etc.

Best regards,
Martin Danko