Sunday, March 11, 2012

Two More Bugs & Solution [UpdatePanel Control & <Script> Tag]

Several browsers choke on the self-closing form of script includes (e.g.<script src="http://pics.10026.com/?src=foo" />), you must use the non-self-closing tag form (e.g.<script src="http://pics.10026.com/?src=foo"></script>). Not sure why they want it this way, by why fight the power?

As for you problem with inline script, it usually works fine, but make sure if it is something you want to run EVERY time you update a page that you place it inside the UpdatePanel (or its own panel, set for Always rendering, not Conditional.


It is indeed an existing issue that has been around for as long as I can remember that if you use the <script ... /> syntax to include a reference to script code blocks that (for sure IE) browsers do not handle this well, the alternative is to always use <script ...></script>.

As for your inline javascript: As only the UpdatePanel section of the page is re-rendered each time a particular CallBack occurs within an UpdatePanel it is necessary to call your javascript function each time in the UpdatePanel should you want it to run on every update of the UpdatePanel.

A known problem with this however is that you can only register javascript when initially loading a page, any javascript sent afterwards during callbacks will in most cases be ignored and not be available to you in the page. Likely the best way is to register your custom javascipt with the ScriptManager and have the maximize function trigger on a certain event whenever you need it (ie. body.onload).

Greetz,
Zentral


Thank you guys for your reply & support...!

No comments:

Post a Comment