Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Window.Location.href method doesnot fire

$
0
0

Hi,

window.location.method wont fire when using Ajax..

  <input value="Continue" class="button" id="btnSubmit" type="submit"/>

$('#btnSubmit').on('click', function () {

$.ajax({
type: 'POST',
contentType: "application/json; charset=utf-8",
url: 'EditAccountInformation.aspx/InsertMethod',
data: "{'FirstName':'" + $('#<%=txt_firstName.ClientID%>').val() + "', 'LastName':'" + $('#<%=txt_LastName.ClientID%>').val() + "','Email':'" + $('#<%=txt_Email.ClientID%>').val() + "','Phone':'" + $('#<%=txt_telephone.ClientID%>').val() + "'}",
async: false,

success: function (response) {
$('#btnSubmit').prop('disabled', false);
$('#btnSubmit').prop('value', 'Add New');

if(response.d=="Saved Successfully")

{
window.location.href = "DetailsMaster.aspx";---Event doesnot fire

}
e.preventDefault();

},
error: function ()
{ console.log('there is some error'); }
});

});

Thanks


Viewing all articles
Browse latest Browse all 5678

Trending Articles