Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > make one webpart visible based on code in a different webpart on the same page View modes: 
User avatar
Member
Member
gatsby0121 - 4/15/2011 5:25:28 AM
   
make one webpart visible based on code in a different webpart on the same page
I have a webpart that's validating user input. Based on the results, I want to make another webpart (registration) on the same page visible.

is there any way to access the other webparts visibility property from my custom webpart?

User avatar
Member
Member
Chanan - 4/15/2011 6:10:59 AM
   
RE:make one webpart visible based on code in a different webpart on the same page
I am not sure if there is a better way, but we had to sync two webparts and weren't able to communicate between the two. In the end we outputted (if that's a word) javascript from the control to to sync the two. You could do the same with visibility (Although of course it will still be in the source but it will not be displayed to the user)

User avatar
Member
Member
gatsby0121 - 4/15/2011 1:32:27 PM
   
RE:make one webpart visible based on code in a different webpart on the same page
Thanks for the suggestion, I ended up copint the registration form into the custom webpart I created, as well as the code behind elements. I then just made the form visible from the code behind.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 4/15/2011 1:47:00 PM
   
RE:make one webpart visible based on code in a different webpart on the same page
Hi,

alternative solution would be to access property using PageInfo API:

PageInfo pi = PageInfoProvider.GetPageInfo(...);
PageTemplateInfo pt = pi.PageTemplateInfo;
WebPartZoneInstance wpzi = pt.GetZone("zoneID");
ArrayList al = wpzi.WebParts;


Best regards,
Ivana Tomanickova