Sorry, I've been meaning to post and update to this for a few days now. Here's the new(er) code.
// because the separator could be an underscore or a dollar sign (or who knows what else)
var viewUpId = $("div[id$='View_UPPanel']").attr("id");
viewUpId = viewUpId.replace("View_UPPanel", "");
var token = viewUpId.charAt(viewUpId.length - 1);
// correct partial postback bug in dnn.
$("div[id$='View_UP']").each(function () {
if (!($(this).parent().attr('id').indexOf("View_UPPanel") >= 0)) {
var prefix = $(this).attr("id").replace("View_UP", "");
$(this).wrap("<div id='" + prefix + prefix.replace(/_/g, token) + "View_UPPanel' />");
}
});
The problem, as noted in the comment, is that on my dev machine they were using an underscore and on the stage computer they were using a dollar sign to separate the concatenation. The above code detects which they are using and then applies that code similar to what I provided before.
This is all part of
$(function ($) {
// code goes here.
});
and does not need to be added to
Sys.WebForms.PageRequestManager.getInstance().add_endRequest
since the part of the DOM we are modifying will never change due to partial rendering.