Portal Engine
Version 3.x > Portal Engine > Code Behinds with Transformations View modes: 
User avatar
Member
Member
chris-ricochetpartners - 11/11/2008 2:56:45 PM
   
Code Behinds with Transformations
I need to add buttons to a transformation. Where would I handle the click events as the transformations don't seem to have code-behind files?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 11/12/2008 5:18:18 AM
   
RE:Code Behinds with Transformations
Hello,

you can use inline code instead of code in behind. E.g. you can insert button and label this way:

<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click"/>
<asp:Label ID="Label1" runat="server" Text="BeforeClick"/>

Then you can enter following code to handle OnClick event:

<script runat="server">

protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text="AfterClick";
}
</script>

Unfortunately, in transformation you cannot use IntelliSense.

Best regards,
Radek Macalik