ASP. NET 2.0 new features Call Back may be troublesome, but you need to create another Web Sevices (. asmx) page. the Web Services page of asmx is too troublesome. There is also a simpler method for non-synchronous calls.Page Method.
You can create a. aspx page and deploy ScriptManager, TextBox, and Html Button in the same way:
Then, enter the following code:
Then, test the running results and you will find that the same method can be called in non-synchronous mode (after the Button is pressed, the TextBox content can be updated using the server information without changing pages ), however, you do not need to create an additional one. the asmx file is slightly refreshed in the program structure. This is how PageMethod is used. Be sure to declare the. aspx PageMethod as a static method (with the shared keyword) and add the following Attribute (line 1-2 ):
For the ScriptManager control on the. aspx page at the same time, you must set its EnablePageMethods attribute to true to use PageMethod correctly.