Rank: Advanced Member Groups: Member
Joined: 1/9/2009 Posts: 97
|
Hi,
I have a custom control/dll that has some JS Resource Files. These file use the registerScriptBloack etc. to write some JS just before the closing FORM tag. This control/dll works fine if it is initially loaded/visible. But if i have it in a HIDDEN DIV(Server-Side) then do a callback to unhide it the JScode is never rendered because the control/dll is set to write the JS before the closing Form tag not inside the callback panel. Is there a way i can fix this easily? as i will not always be using a callback panel either and thats why i used the RegisterScript procedures
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
That won't work. :) You will need to make sure all JavaScript code is correctly rendered before the Callback. The easiest (also the cheapest) workaround is to place such a control outside of the CallbackPanel but set its style:display to none. So that it is there but visually invisible. The "real" solution requires you to modify the control so that it knows how to handle this situation. A lot of third party controls can handle ASP.NET AJAX UpdatePanel because it is from MS. So you may want to give that a try.
Thanks!
|