torsdag 20 september 2007

AjaxControlToolkit: Events inside a Accordion

If you having problems with needing to click twice or more on a button inside a AccordionPane to get the Event to fire this is a workaround for you.

In this example we have the following structure.


  • MasterPage

    • Page

      • MyAccordion

        • MyUserControl

          • MyButton

In the Page OnInit you simply put the following line:

LinkButton btn =(LinkButton)(MyAccordion.Panes[0].FindControl("MyUserControl").FindControl("MyButton"));

This will make the Accordion to force to load the OnInit in MyUserControl and thus register the MyButton_Click event. It will also enable all other events inside the usercontrol

Hopefully a fix for this will come in a later version of the AjaxControlToolkit.

Reference: http://forums.asp.net/t/1047516.aspx

Inga kommentarer: