How to use Banner Rotator webpart in Transformation?

Aashish Khandelwal asked on January 14, 2015 15:23

How can I write the code for including Kentico Banner Rotator webpart in Transformations?

Regards
Aashish Khandelwal

Recent Answers


Roman Hutnyk answered on January 14, 2015 15:53

have you checked documentation?

0 votesVote for this answer Mark as a Correct answer

Aashish Khandelwal answered on January 14, 2015 16:04

Roman,

Yes, I checked the documentation and I am aware of this thing but I am looking for the exact code to include the Banner Rotator.

Regards
Aashish

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 15, 2015 04:28

You don't use webparts in transformations, you use controls. You'd have to look into the code of the Banner Rotator webpart to find out what control is being used and set the properties of that control as needed.

After looking at the webpart, these are the controls used:

<asp:HyperLink runat="server" id="lnkBanner" Visible="false">
    <asp:Literal ID="ltrBanner" runat="server" Visible="false"></asp:Literal>
    <asp:Image ID="imgBanner" runat="server" Visible="false" />
</asp:HyperLink>

In the code behind it sets some properties but nothing I don't think you can't do in a transformation. Take a look at the code to get some ideas /CMSWebParts/BannerManagement

0 votesVote for this answer Mark as a Correct answer

Aashish Khandelwal answered on January 15, 2015 09:04 (last edited on January 15, 2015 15:33)

Brenden,

Technically ASP.NET web user-control and Kentico Web part is one and the same thing. I was looking at the BannerRotator properties but could not find the property to set the BannerCategory.

Thanks,
Aashish Khandelwal

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 15, 2015 16:34

Technically an ASP.NET user control and a Kentico Webpart are NOT the same, they two different things. Which is why there is a webpart that accepts an ASP.NET user control. A Kentico webpart uses different page lifecycle than a standard ASP.NET user control.

If you look at all the webparts that are included and that you create, they all inherit the same CMSAbstractWebpart class. They all also use either regular controls (< asp:Label > < asp:TextBox > < cms:LocalizedLabel > etc) or another ascx control with those controls because of the page lifecycle differences.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.