<p>I am working with ASP.net.<br><br>
I am trying to call a method that exists on the base class for the page I am using. I want to call this method via Javascript and do not require any rendering to be handled by ASP.net.<br><br>
What would be the easiest way to accomplish this.
<br><br>
I have looked at PageMethods which for some reason are not working and found that a lot of other people have had trouble with them.</p>

[{'answer_id': 67637, 'author': 'Thunder3', 'author_id': 2832, 'author_profile': 'https://Stackoverflow.com/users/2832', 'pm_score': 3, 'selected': True, 'text': '<p>It depends on what the method relies on, but assuming it is a static method or that it does not rely on the Page Lifecycle to work, you could expose a webservice endpoint and hit that with whichever Javascript calling mechanism you would like to use.</p>\n'}, {'answer_id': 68341, 'author': 'azamsharp', 'author_id': 3797, 'author_profile': 'https://Stackoverflow.com/users/3797', 'pm_score': 1, 'selected': False, 'text': '<p>What library are you using to make Ajax calls? If you are using JQuery then you can create static methods and call them on your page. Let me know if you need further help!</p>\n'}, {'answer_id': 297309, 'author': 'Robert Wagner', 'author_id': 10784, 'author_profile': 'https://Stackoverflow.com/users/10784', 'pm_score': 0, 'selected': False, 'text': '<p>As Thunder3 suggests, expose a Web Service. Once you have done this, you can register the webservice with the ScriptManager (or ScriptManagerProxy), which will cause a JavaScript wrapper to be generated. This wrapper gives you a good interface to the call.</p>\n'}, {'answer_id': 297326, 'author': 'Toran Billups', 'author_id': 2701, 'author_profile': 'https://Stackoverflow.com/users/2701', 'pm_score': 0, 'selected': False, 'text': '<p>To extend on the point made by <a href="https://stackoverflow.com/users/3797/azamsharp">@Azam</a>, if you don\'t want to render the html on the page, you can set the return type to something else such as xml and do a response.write like I have in the code below.  During the GET I want to send back the html, but during the POST I send back some XML over the wire.</p>\n\n<pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\n        Response.Cache.SetCacheability(HttpCacheability.NoCache)\n        If Request.HttpMethod = "GET" Then\n            \'do some work and return the rendered html\n        ElseIf Request.HttpMethod = "POST" Then\n            \'do some work and return xml\n            Response.ContentType = "text/xml"\n            Response.Write("&lt;data&gt;&lt;/data&gt;")\n            Response.End()\n        Else\n            Response.StatusCode = 404\n            Response.End()\n        End If\n    End Sub\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/67621', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3821/']