Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: "POST",
- url: postUrl + "/SomePageMethod",
- data: "{searchString:"" + escape(searchString) + ""}",
- contentType: "application/json; charset=utf-8",
- beforeSend: function(xhr) {
- xhr.setRequestHeader("X-MicrosoftAjax","Delta=true");
- },
- dataType: "json",
- success: onSuccess,
- error: onError
- });
- function onError(xhr, e, textStatus) {
- var isAjaxRedirect = xhr.status == 200 && xhr.responseText.match(/pageRedirect/);
- if (isAjaxRedirect == "pageRedirect") {
- // forms authentication ticket expired
- location.href = "a session timeout page, or a login page or whatever";
- }
- }
Add Comment
Please, Sign In to add comment