How to redirect an asp.net webform to another webform using javascript? -


I have the following script in my asp.net webform project, and I want to redirect to a new page Let's say NewForm . How do I do ASPX in my project? I have tried the window.location.href but it is not working, some help would be appreciated, thanks!

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ('# btn submit') Click (function () {$ .ajax ({type: 'POST', Content Type: 'application / json; charset = utf-8 ', Url:' DetailsForm.aspx / InsertMethod ', data: "{' firstname ':'" + document.getElementById ('firstname'). Value + "',' lastname ':'" + document.getElementById ('lastname Val (''); $ ('# lastname'). Val (''); Warning ("Record saved successfully in database!");}, Error: task () {console.log ('some Error is');}})});}); & Lt; / Script & gt;  


Comments