how to redirect from one page to another page using Ajax or Java Script Or Json

Posted by Johnseelan under Regular Expressions on 7/8/2011 | Points: 10 | Views : 6429 | Status : [Member] | Replies : 1
Hi, All

how to redirect from one page to another page using Ajax or Java Script Or Json
the below code is not working y.

var CancelButton = "<input type=\"button\" id=\"Cancelbtn\" onclick=\"cancelFile()\" value =\"Cancel\"" + disablestatus + "/>";

function cancelFile() {
var fname = $('#status');
//document.getElementById('savebtn').disabled = true;

$('#Cancelbtn').attr("disabled", true);
$.ajax({
url: '@Url.Action("Cancel")',
type: 'POST',
contentType: 'application/json',
fname: fname.val('UserManagementController/CreateUser'),
data: JSON.stringify({ fname: fname.val() }),

success: function (data, result) {
if (data.redirect) {
window.location.href(data.redirect);
}

}

});
}




Responses

Posted by: Taanu51 on: 7/8/2011 [Member] Starter | Points: 25

Up
0
Down
HI
Check out this links..may be help you
http://taanu51.blogspot.com/2011/02/how-to-transfer-values-from-one-page-to.html

http://taanu51.blogspot.com/2011/02/how-to-automatically-redirects-to.html

http://taanu51.blogspot.com/2011/02/how-to-create-logout-page-using.html

Let me know...



Tanisha Sayyad
.Net and Android Developer
INDIA(Andhra Pradesh)

Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response