I'm trying to use Google's jstemplate as a client-side templating engine on an ASP.NET page, and it seems to be conflicting with ASP.NET AJAX. The problem is not jstemplate.js but util.js, which it needs as a support file.
I've isolated the problem as follows::
<%@ Page Language="VB" %>
<body>
<form id="form1" runat="server">
<asp:scriptmanager id="ScriptManager" runat="server" enablepartialrendering="true">
<scripts>
<asp:scriptreference path="http://google-jstemplate.googlecode.com/svn/trunk/util.js" />
</scripts>
</asp:scriptmanager>
</form>
</body>
</html>
When I run this I get this error
Microsoft JScript runtime error: 'type' is null or not an object`
on this line of MicrosoftAjax.js
:
Sys.UI.DomEvent = function Sys$UI$DomEvent(eventObject) {
...
var etype = this.type = e.type.toLowerCase();
Referencing the javascript in a normal <script>
block (as opposed to inside the ScriptManager) has the same effect.
I haven't dug into it but I suspect there's just a namespace collision. Has anyone successfully used Google's util.js file alongside ASP.NET ajax? Or should I just look into alternative client-side templating engines?