Wednesday, March 21, 2012

Event/Value triggers from custom user controls

Hi, here is my problem:
I have a menu made up of asp:LinkButton(s), each one with some unique id
the menu itself is a usercontrol holding these LinkButtons in some form or another
Now, since i have many such buttons i don't want to add:
<trigger>
<atlas:ControlEventTrigger ControlID="Menu$someLinkButton" EventName="Click" />
</trigger
for each one of my LinkButtons but rather have something like:
<trigger>
<atlas:ControlEventTrigger ControlID="Menu" EventName="ItemClicked" />
</trigger>
(or use the value somehow)

to do this i need to add an event to my "Menu" and then i need to raise it somehow before postback
so only partial rendering will be done.

Can any1 help me as to how to set this up?

Tx in advance,
MeWHy dont you have a TreeView control inplace of the linkbuttons, so you can use the SelectedNodeChanged event of the TreeView?

Thanks
Well, for one thing, i need to write from right to left, and the i didn't find anywhere in the treeview support for this kind of thing.
Other than that, why not use my own? i just need to know how to setup the event and have the <atlas:updatecontrol> catch it when it triggers. i'm just not sure how to go about implementing this (altho i'm pretty sure it can't be that difficult), need someone to show me the ropes.

No comments:

Post a Comment