Hi-
What I am trying to do is render a View in an MVC site informing the user to not refresh their browser while server side processing is taking place. This could be a long running task, and if they hit refresh it will send the request again, thus sending them to the error screen when the process was actually successful. I was going to do this in JS, either with JQuery $.ajax(...) or with a simple $(document).ready(function() { window.location = ... }); but I was hoping there was a way to do it in MVC, thus giving me more control over the HttpResponseCode which is returned to the client calling. Is there a way to do this?
I was thinking along the lines of
public ActionResult LoadingAsync(string UserKey, string userInf)
{
AsyncManager.OutstandingOperations.Increment();
CallProcess(...)
return View();
}
then have a Completed Action perform the redirect
public ActionResult LoadingCompleted()
{
LongRunningProcess();
return Redirect("http://yourdone.com");
}
or just have something that Renders inside the view that will perform the Redirect from inside the View
<% Html.RenderAction("Process"); %><!--This won't actually redirect-->
Any ideas?