Portal Engine
Version 3.x > Portal Engine > Custom Web Part Question View modes: 
User avatar
Member
Member
eranc-angieslist - 1/13/2009 5:00:33 PM
   
Custom Web Part Question
Hello,

I have created a custom web part (AdManager) with a new attribute (property) named “AdSlot”.

The attribute has the following properties:
Attribute name: AdSlot
Attribute type: Text
Attribute size: 200
Allow empty value: Yes
Attribute default value:

When the AdManager is added to a page and the AdSlot attribute is configured with the value “TestSlot” through the CMS Desk, how can I access that value in the OnLoad function of AdManager.ascx.cs?

Thanks.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/14/2009 1:56:42 AM
   
RE:Custom Web Part Question
Hi,

You need to register your property also in Site Manager as described here - http://www.kentico.com/docs/devguide/developing_web_parts.htm. Then you can access its value by using "GetValue()" and "SetValue()" methods in the code behind. These methods may take some arguments.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
eranc-angieslist - 1/14/2009 10:13:06 AM
   
RE:Custom Web Part Question
Thanks! That's exactly what I was looking for. Is there any documentation on the functions in CMSAbstractWebParts?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/15/2009 1:06:14 AM
   
RE:Custom Web Part Question
Hi,

You can find more information in our API documentation - http://devnet.kentico.com/downloads/kenticocms_api.zip.

This class is listed under CMS.PortalControls section (namespace).

Best Regards,
Juraj Ondrus