javascript - start auto refresh page with click on button -
i have update panel contain gridview wanna page auto update. wrote fallowing snippet problem when locate code in document.ready work when locate in on click of button dont work code;
var temp; $(document).ready(function () { var refreshid = settimeout(function () { if (temp == 1) { $('#menu').load('webform11.aspx'); } }, 5000); }); function button2_onclick() { temp = 1; }
try setinterval insteadof settimeout
var temp; $(document).ready(function () { var refreshid = setinterval(function () { if (temp == 1) { $('#menu').load('webform11.aspx'); } }, 5000); }); function button2_onclick() { temp = 1; }
Comments
Post a Comment