Created
January 6, 2012 07:08
-
-
Save jmarnold/1569467 to your computer and use it in GitHub Desktop.
Continuations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
success: true/false, | |
refresh: true/false | |
message: '', | |
errors: [] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup({ | |
success: function (continuation, status, jqXHR) { | |
self.onSuccess({ | |
continuation: continuation, | |
status: status, | |
response: jqXHR | |
}); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onSuccess: function (msg) { | |
var contentType = msg.response.getResponseHeader('Content-Type'); | |
if (!contentType || contentType.indexOf('json') == -1) { | |
return; | |
} | |
self.process(msg.continuation); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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