i simply want the button click to redirect to a different page.. at the beginning my code looked like this :
<asp:Button runat="server" ID="Register_BTN" Text="Register here !"
OnClientClick="Register_BTN_Click();"/>
<script type-"text/javascript">
function Register_BTN_Click() {
window.location.href("Registration.aspx");
}
the error that was thrown : Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.
i have searched about it online and found this question : JavaScript console.log causes error: "Synchronous XMLHttpRequest on the main thread is deprecated..."
later i changed the code :
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
$.ajaxSetup({async:true});
function Register_BTN_Click() {
window.location.href("Registration.aspx");
}
and still same exception..
also tried this change and it didn't help..
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
$.ajax({
async: true, // this will solve the problem
type: "POST",
url: "/Page/Method",
contentType: "application/json",
data: JSON.stringify({ ParameterName: paramValue }),
});
function Register_BTN_Click() {
window.location.hash("Registration.aspx");
}
how can i fix this ? Thanks