I ran into a little problem trying to integrate Metabuilders combobox into an asp.net web app I am creating.
The problem was that the onload event handler was not properly firing when smartNav was turned on.
The "InitScript" was as follows:
if ( typeof( window.addEventListener ) != "undefined" ) { window.addEventListener("load", ComboBox_Init, false); alert('case 1');} else if ( typeof( window.attachEvent ) != "undefined" ) { window.attachEvent("onload", ComboBox_Init);} else { ComboBox_Init();}
Well when you are using smartNav, the window.onload event is only fired the first time you reach the page. So I used this bit of C# in the control to get it to work.
String initScript = resources.GetString("InitScript");if (this.Page.SmartNavigation){ this.Page.RegisterStartupScript("MetaBuilders.WebControls.ComboBox Init with Smartnav", "<script>ComboBox_Init();</script>");}else{ this.Page.RegisterStartupScript("MetaBuilders.WebControls.ComboBox Init", initScript); }
Remember Me
Powered by: newtelligence dasBlog 1.9.6264.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
E-mail
Theme design by Jelle Druyts