Apr 25, 2008, 7:38 AM
[FIXED] [V0.5] RegisterClientOnReadyInitBlock causes error
Hello, I wanted to convert ASP.NET dropdownlist to ExtJS combo using JS code from ExtJS examples (http://extjs.com/deploy/dev/examples/form/combos.html) (I use hidden field, because I cannot pass DropDownList to RegisterClientOnReadyInitBlock method as 1st parameter). This code is in Page_Load method:
When I paste the rendered HTML to static HTML page and swapped the script tags, it worked (i.e. both scripts cool.axd first and then Ext.onReady)
Thanks for your help.
ScriptManager1.RegisterClientOnReadyInitBlock(HiddenField1, "DropDownList1-OnReady",
@"var converted = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'DropDown1',
width:135,
forceSelection:true });");
and following code is rendered<script type="text/javascript">
//<![CDATA[
Ext.BLANK_IMAGE_URL='/WebSite1/cool/extjs/resources/images/default/s/gif/cool.axd';Ext.onReady(function(){Ext.QuickTips.init();var converted = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'state',
width:135,
forceSelection:true
});
// furthercode ...
this.HiddenField1=new Ext.form.Hidden ({applyTo:"HiddenField1_TextBox",id:"HiddenField1"});});
</script>
<!-- Coolite ASP.NET Web Controls [Community Edition]. Version 0.4.1.42666. "Default" Theme. -->
<link rel="stylesheet" type="text/css" href="/WebSite1/cool/extjs/resources/css/ext-all-embedded/css/cool.axd" />
<script type="text/javascript" src="/WebSite1/cool/extjs/adapter/ext/ext-base/js/cool.axd"></script>
<script type="text/javascript" src="/WebSite1/cool/extjs/ext-all/js/cool.axd"></script>
which causes error, because Ext is referenced before script libraries are loaded. Without registration everything works fine. I tried to move ScriptManager tag up and down the page, but it didn't help.When I paste the rendered HTML to static HTML page and swapped the script tags, it worked (i.e. both scripts cool.axd first and then Ext.onReady)
Thanks for your help.