Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Get current page which containing the webpart View modes: 
User avatar
Member
Member
Nel215 - 2/10/2013 5:47:54 PM
   
Get current page which containing the webpart
halo,

I am trying to create a webpart to change attributes of some UI controls (like button,textbox), I search the api document and find something like findcontrols which is similar to the traditional ASP.NET Page.findcontrol() mehtod. I guess what I need to do is to get the containing page first then I can use the findcontrol methods. but I am not clear how to get the page or are there any ways I can do samething?

Thanks in advance

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 2/11/2013 1:24:42 PM
   
RE:Get current page which containing the webpart
In a webpart you can access the DocumentEngine.TreeNode by using
CMSContext.CurrentDocument

User avatar
Member
Member
Nel215 - 2/11/2013 4:52:56 PM
   
RE:Get current page which containing the webpart
Thanks for that.
Does the CMSContext.CurrentDocument had any method similar to findcontrol() so I can use to get the control?
Sorry I am new to kentico

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 2/12/2013 2:34:31 AM
   
RE:Get current page which containing the webpart
Hi,

Unfortunately not, there is no method which can find a control on the current page.

Best regards,
Martin Danko