Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Unassigned: Timer and Script Combining w/ ToolkitScriptManager [27639]

$
0
0
I've found a bug with how script combining works with the Timer control. Although, this is so basic that if anybody can see if I'm doing something wrong, please let me know. I want to use a Timer control with a ToolkitScriptManager. When script combining is turned off, everything works fine. But by changing the ToolkitScriptManager.CombineScripts property to true, the Timer control never fires the Tick event. If I debug the javascript, I see an error message saying "undefined is not a function". The code is very simple:

```
<%@ Page Language="VB" %>
<%@ Register TagPrefix="ajax" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>
<script runat="server">

Protected Sub tmrTest_Tick(Sender As Object, Args As EventArgs)
Dim objLabel As Label = CType(FindControl("lblTest"), Label)
objLabel.Text = (CInt(objLabel.Text) + 1).ToString()
End Sub

</script>
<html>
<body>
<form runat="server" id="frmTest">
<ajax:ToolkitScriptManager runat="server" id="scpManager" EnablePartialRendering="True" CombineScripts="True" />
<asp:Timer runat="server" ID="tmrTest" Interval="2000" OnTick="tmrTest_Tick" />
<asp:UpdatePanel runat="server" id="upnlTest">
<ContentTemplate>
<asp:Label runat="server" ID="lblTest" Text="1" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
```

If you change the CombineScripts property to False, it works fine. When the value is True, it fails. I've made sure the CombineScriptsHandler.axd handler is registered in my web.config, but this just doesn't work. Can anybody give me a little guidance on this, or is this a known issue?
Comments: To resolve this issue create a AjaxControlToolkit.config create a list of the controls you use example: ``` <ajaxControlToolkit> <controlBundles> <controlBundle> <control name="Accordion" /> <control name="CollapsiblePanelExtender" /> <control name="TabPanel" /> <control name="TabContainer" /> <control name="AutoCompleteExtender" /> <control name="ModalPopupExtender" /> <control name="CalendarExtender" /> <control name="ConfirmButtonExtender" /> </controlBundle> </controlBundles> </ajaxControlToolkit> ``` Then add the following before </ajaxControlToolkit> ``` <scripts> <add name="MicrosoftAjaxTimer.js" /> </scripts> ```

Viewing all articles
Browse latest Browse all 4356

Trending Articles