title: ASP.Net, Drag-n-Drop, Postbacks, and Control IDs
body: <p>The title attempts to summarize the problem, but here's a more detailed summary: our web page is a collection of usercontrols, which visually render as rectangular reporting widgets, which are set in AJAX updatepanels.  We are giving the user the ability to drag and drop the widgets to pre-set "zones" on the page.  </p>
  
  <p>The drag and drop functionality works fine.  We use AJAX calls to a web service to update a database with the user's new settings for persistence.  </p>
  
  <p>The "however" happens when we do a postback from one of these widgets.  The postback is sent to the server, it renders an update, which is sent back to the client (all via AJAX, because of the updatepanel).  We then get a "Could not find UpdatePanel with ID..." message on the client, because the document hierarchy has changed, but the control IDs have not been updated on the client.</p>
  
  <p>We tried Rick Strahl's solution to this <a href="http://www.west-wind.com/WebLog/posts/4605.aspx" rel="nofollow noreferrer" title="(link here)">link text</a>, which allowed us to create static control IDs on the client.  This breaks the postback functionality, though... the isPostBack property is not set, I'm assuming because the server can't match the control ID with a known hierarchy element.</p>
  
  <p>We're thinking about possibly resetting the control ID on the client side after it's dragged and dropped, using Javascript.  Obviously, this would require duplicating .Net's naming algorithm--not smart, we're thinking.  Maybe we can use a separate updatepanel and ask the server to send us the new control ID after it's dropped?  </p>
  
  <p>Obviously, we're running out of ideas.  </p>
  
  <p>I realize this is probably too long, and I'll happily edit, provide code samples, etc. to help you help us.  Thank you in advance.</p>