Feb 22, 2013, 9:25 PM
Another option if you want to avoid adding a ResourcePlaceHolder into the <head> is to tap into the <DocumentReady> event of the ResourceManager.
The following sample demonstrates the whole scenario.
Example
Hope this helps.
The following sample demonstrates the whole scenario.
Example
<%@ Page Language="C#" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET Example</title>
<script type="text/javascript">
var init = function () {
// Using Ext.getCmp
console.log("Button", Ext.getCmp('Button1'));
// Directly referencing the App namespace instance
console.log("Button", App.Button1);
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server">
<Listeners>
<DocumentReady Fn="init" />
</Listeners>
</ext:ResourceManager>
<ext:Button ID="Button1" runat="server" IDMode="Static" Text="Submit" />
</form>
</body>
</html>
Still not ideal, but is presented as another option which may be cleaner for your application. Hope this helps.