I have an SPLongOperation that occasionally fails to redirect the user to a new page when the operation completes. I'm not sure what circumstances cause the problem, since I don't yet have a reliable way to reproduce it. Here is the code I am using:
using (SPLongOperation createOp = new SPLongOperation(this.Page)) {
createOp.LeadingHTML = "Title";
createOp.Begin();
string error = DoSomeLongRunningStuff();
if (String.IsNullOrEmpty(error)) {
createOp.End(this.Web.Url);
} else {
createOp.End(SPUtility.ErrorPage, SPRedirectFlags.RelativeToLayoutsPage, HttpContext.Current, "ErrorText=" + error);
}
}
When the problem occurs, it's clear that the long operation has completed successfully (i.e. DoSomeLongRunningStuff() returns a result), but the user is never redirected to a new page. Does anyone know of any reason why redirection might fail?