Wednesday, March 21, 2012

XML Script inside UpdatePanel: Not instantiated?

I have a bit of XML-Script (which assigns a Drag/Drop handle behavior to a control) that performs as expected. However, if I place this script inside an UpdatePanel then the script doesn't run. Is this a known issue? Any known workarounds? If not, can anyone provide me with insight on how the AJAX libraries identify and parse XML-script? E.g., Is there a function I can call that will reinitialize XML-Script blocks? Note: I can put a <script type="text/javascript" /> in an UpdatePanel and it'll execute as expected.

Jeremy

Bumping this thead. Any thoughts? Let me know if I need to clarify the request. The obvious work around is to just wire up the features using imperative syntax via Javascript, although this seems like a pretty obvious issue so I want to make sure I'm not missing something.


Can you please post the code you are using so I can take a look at it? Thanks


I later discovered that this functionality was by design and that any script (not just XML script) will not re-execute upon refresh of an UpdatePanel. There are a few work arounds posted for this on the internet which involve registering the script, probably via RegisterClientScriptBlock() or something similar. The approach didn't work for me, however, and I haven't had a chance to dive into this further yet. When I get a chance I will revisit this and post code samples and/or findings.

No comments:

Post a Comment