asp.net under the Pagemethods use skills _ practical skills

Source: Internet
Author: User

Used to be a Web project to develop the Web site, in a number of places to use pagemethods, can be said to be familiar. This time I would like to try the Web site method, because the code changes do not compile, refresh the page will be able to see the effect, this is more convenient.

But when I used pagemethods, I got into trouble. Add the ScriptManager, add the [WebMethod] feature to the static method, but the page output just can't see the ScriptManager: ( I think it's a problem with. NET 3.5 or vs2008, Google has no answer. Also suspected that the site is a handlers or cause errors, re-examine, and remove all handlers test, the result is not.

When you're about to crash, notice a problem, the example given in MSDN is in an ASPX file, and my code is in the CodeFile, is this a problem? Move your static code to the ASPX file, refresh the page, pagemethods it out!!!

You almost hit the computer.

Why is there such a limit? Why do you want pagemethods in an ASPX file to be effective ....

Scriptmanager.enablepagemethods= "true"

static method definition

JS calls the method.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.