Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Custom code to page template View modes: 
User avatar
Member
Member
wade.cormie-gmail - 4/7/2011 3:23:28 PM
   
Custom code to page template
I have a document type that uses a custom template I created.

When any page loads that uses that template, I need to query a custom table in the database, check if an id exists, and then allow or deny access to that page.

For the life of my I can't figure out how to edit the code behind of that page to do this. It requires custom coding, since the table is not a kentico table.

How do I access the code behind?

User avatar
Member
Member
Chanan - 4/7/2011 3:29:08 PM
   
RE:Custom code to page template
We do something somewhat similar.

We created a webpart with the code you need to do the security check and we than redirect if needed to a login page.

User avatar
Member
Member
wade.cormie-gmail - 4/7/2011 3:32:51 PM
   
RE:Custom code to page template
So just create a webpart that does the check, and put it in the template of the page in question?


User avatar
Member
Member
Chanan - 4/7/2011 3:36:31 PM
   
RE:Custom code to page template
Yep

User avatar
Member
Member
wade.cormie-gmail - 4/7/2011 3:41:39 PM
   
RE:Custom code to page template
Perfect, just gave it a go, and it worked!

Thanks for the tip!