What is "pagemethods"
PageMethods
is a feature of the ASP.NET platform for use with ajax that exposes page methods through structured Ulrs.
They are defined by a static method on a page decorated with the attribute [WebMethod]
and accessed via Javascript through calls in the format PageMethods.NomeDoMetodo(...)
.
This is very useful when you want a function that is on the server to return values or simply execute commands without returning anything.
A requisition ajax in a method your page does not need to load it again, returning only the code needed to effect the changes on the page.
What you will need:
- Function to be executed on the server side tab;
- Javascript functions for handling this function;
- "Pagemethod" Script Manager (the same one you already use for enable Ajax Scripts on the page).