Skip to content

Instantly share code, notes, and snippets.

@jmarnold
Created January 6, 2012 07:08
Show Gist options
  • Save jmarnold/1569467 to your computer and use it in GitHub Desktop.
Save jmarnold/1569467 to your computer and use it in GitHub Desktop.
Continuations
{
success: true/false,
refresh: true/false
message: '',
errors: []
}
$.ajaxSetup({
success: function (continuation, status, jqXHR) {
self.onSuccess({
continuation: continuation,
status: status,
response: jqXHR
});
}
});
onSuccess: function (msg) {
var contentType = msg.response.getResponseHeader('Content-Type');
if (!contentType || contentType.indexOf('json') == -1) {
return;
}
self.process(msg.continuation);
}
public class SomeController
{
public AjaxContinuation Index(CreateUserModel model)
{
return AjaxContinuation.Successful();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment