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: Not sure if it matters but I have Enabled="true" on my <asp:Timer line. I also put my <asp:Timer line within the update panel itself. Probably the main issue you are having is that the current AjaxControlToolkit is buggy as hell (for me with .Net 4.0 at least) since the July 2013 version. Try removing the AjaxControlToolkit (hopefully via NuGet since it is easier) and then use the Package Manger Console to install the June 2013 version and see if that helps. Here is how you uninstall it via NuGet on the Package Manager Console command line (only if you used NuGet to install the other one): Uninstall-Package AjaxControlToolkit Here is how you install that old version via NuGet on the Package Manager Console command line: Install-Package AjaxControlToolkit -Version 7.607.0

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>