ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Execute WebMethod (PageMethod) on every minute using using AJAX and JavaScript in ASP.Net<p>Hi&nbsp;Shahzad786,</p> <p>Use SetInterval&nbsp;function.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;asp:ScriptManager runat=&#34;server&#34; EnablePageMethods=&#34;true&#34; /&gt; &lt;script type=&#34;text/javascript&#34;&gt; window.onload = function () { // Set interval. Currently it is 1 sec. setInterval(ShowMessage, 1000); } function ShowMessage() { PageMethods.Message(Success, Failure); function Success(result) { alert(result); } function Failure(error) { alert(error); } } &lt;/script&gt;</pre> <p><strong><span style="text-decoration: underline;">C#</span></strong></p> <pre class="brush: csharp">[System.Web.Services.WebMethod] public static string Message() { return &#34;Welcome to ASPSnippets.com&#34; + &#34;\n\r&#34; + DateTime.Now; }</pre> <p><span style="text-decoration: underline;"><strong>VB.Net</strong></span></p> <pre class="brush: vb">&lt;System.Web.Services.WebMethod()&gt; Public Shared Function Message() As String Return &#34;Welcome to ASPSnippets.com&#34; &amp; vbLf &amp; vbCr &amp; DateTime.Now End Function</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/JreP9it.gif" alt="" width="249" height="195" /></span></strong></p>https://www.aspforums.net:443/Threads/416579/Execute-WebMethod-PageMethod-on-every-minute-using-using-AJAX-and-JavaScript-in-ASPNet/https://www.aspforums.net:443/Threads/416579/Execute-WebMethod-PageMethod-on-every-minute-using-using-AJAX-and-JavaScript-in-ASPNet/Mon, 19 Nov 2018 02:20:53 GMT