Javascript and Update Panels

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gotejjeken
    New Member
    • Sep 2007
    • 27

    Javascript and Update Panels

    I've been using the Dojo Toolkit to implement Drag and Drop in my page, and all works fine until an asynchronous postback occurs, then the Javascript stops functioning. In my .NET page I have this in my Page_Load:

    Code:
     ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "dojo", "<script type='text/javascript' src='/Pages/dojosource/dojo/dojo.js' djConfig='parseOnLoad: true'></script>", false);
    
    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "dojo_required", "dojo.require('dojo.dnd.Source'); dojo.require('dojo.parser');", true);
    This loads the script dynamically fine, but an asynch postback still causes my Javascript not to function. Is there any way to load these files dynamically and have them function after such a postback?
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Is the JavaScript an embedded resource?

    Comment

    • Gotejjeken
      New Member
      • Sep 2007
      • 27

      #3
      The Javascript is just sitting in a folder called dojosource. I then want to reference that folder and compile the dojo.js class, and then the two other required classes. As mentioned this works fine on a normal postback but gets messed up if an UpdatePanel is used.

      Comment

      Working...