Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Filter control with dynamically created link buttons View modes: 
User avatar
Certified Developer v6
Certified Developer v6
Nortech - 9/27/2010 9:11:46 AM
   
Filter control with dynamically created link buttons
I'm try to build a filter that has a number of options. Each option is a link button linked to an OnCommand event. The link buttons are created with a repeater. Here is the aspx code.

<asp:Repeater ID="repType" runat="server">
<ItemTemplate>
<asp:LinkButton ID="TypeFilterValues" Text='<%#Eval("Name") %>' runat="server" CommandArgument='<%#Eval("NodeAlias")%>' CommandName="Type" OnCommand="LinkButton_Command"></asp:LinkButton>
</ItemTemplate>
<SeparatorTemplate>, </SeparatorTemplate>
</asp:Repeater>

The onCommand event fires only when the repeater is data binded (on the SetUpControl() method) on every postback call. Is this normal? Is there a way to avoid reloading the repeater on every postback?

Regards,

Ulysses

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/8/2010 7:57:36 AM
   
RE:Filter control with dynamically created link buttons
Hi,

Are you using our filter or are you building a custom one?
In our web parts and controls is the life cycle a bit different, so the behavior is normal and by design.

I would recommend to create a fully custom user control for the filter and then load it dynamically by using the "User control" web part where you will specify the code file of your custom control.

Best regards,
Juraj Ondrus