torsdag 20 september 2007

Using ToolkitScriptManager CombineScripts with url rewrite

When you use HttpModule to handle generated htm url's the ToolscriptsMangers CombineScript dosn't work.

To fix this you can add the CombineScriptsHandlerUrl and set this value to "/".

<ajaxtoolkit:toolkitscriptmanager id="ToolkitScriptManager1" runat="server" asyncpostbacktimeout="900" combinescripts="true" combinescriptshandlerurl="/" loadscriptsbeforeui="true">

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