To make my comment more concrete, here's the idea:
reloadDropDown = function (newValue)
{
var requestManager = Sys.WebForms.PageRequestManager.getInstance();
function EndRequestHandler(sender, args) {
// Here's where you get to run your code!
selectNewValueInDropDown(newValue);
requestManager.remove_endRequest(EndRequestHandler);
}
requestManager.add_endRequest(EndRequestHandler);
__doPostBack("DropDown1", "");
}
Of course, you probably want to handle race conditions where two requests overlap. To handle that, you would need to keep track of which handler is for which request. You could use something like ScriptManager.RegisterDataItem
on the server side, or call args.get_panelsUpdated()
and check to see if the panel you're interested it was updated.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…