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.Call WebMethod from other ASPX page using jQuery AJAX<p>Hi <a class="username" rel="mukesh1"> mukesh1</a>,</p> <p>Yes it is possible. For this you need to specify correct URL. Check the below example.</p> <p>In the below example i have a WebMethod <span style="text-decoration: underline;">GetCurrentTime</span> which is in <span style="text-decoration: underline;">Default</span> page and i am calling the WebMethod in <span style="text-decoration: underline;">CS</span> page.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <p><strong>CS.aspx</strong></p> <pre class="brush: html">&lt;div&gt; Your Name : &lt;asp:TextBox ID=&#34;txtUserName&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt; &lt;input id=&#34;btnGetTime&#34; type=&#34;button&#34; value=&#34;Show Current Time&#34; onclick=&#34;ShowCurrentTime()&#34; /&gt; &lt;/div&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; function ShowCurrentTime() { $.ajax({ type: &#34;POST&#34;, url: &#34;Default.aspx/GetCurrentTime&#34;, // Specify the WebMethod page url data: &#39;{name: &#34;&#39; + $(&#34;#txtUserName&#34;).val() + &#39;&#34; }&#39;, contentType: &#34;application/json; charset=utf-8&#34;, dataType: &#34;json&#34;, success: function (response) { alert(response.d); }, error: function (response) { alert(responseresponseText); }, failure: function (response) { alert(response.d); } }); } &lt;/script&gt;</pre> <p><strong><span style="text-decoration: underline;">Code</span></strong></p> <p><strong>Default.aspx.cs</strong></p> <pre class="brush: csharp">[System.Web.Services.WebMethod] public static string GetCurrentTime(string name) { return &#34;Hello &#34; + name + Environment.NewLine + &#34;The Current Time is: &#34; + DateTime.Now.ToString(); }</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><img src="https://i.imgur.com/Io3EuXT.jpg" alt="" width="343" height="269" /></p>https://www.aspforums.net:443/Threads/201142/Call-WebMethod-from-other-ASPX-page-using-jQuery-AJAX/https://www.aspforums.net:443/Threads/201142/Call-WebMethod-from-other-ASPX-page-using-jQuery-AJAX/Wed, 13 Jun 2018 04:35:18 GMT