We recommend that you use web service instead of PAGE method in the implementation of the Atlas server.

Source: Internet
Author: User

Http://dflying.dflying.net/1/archive/107_prefer_web_services_to_page_methods_in_atlas_server_side_implementation.html

We can expose a server segment to the client in two ways.AtlasCall:Web ServiceAndPage Method. I recommend that you useWeb Service.

One point that everyone should pay great attention to isWeb ServiceAndPage MethodThe working principle and process are quite different. ForAtlasCallWeb ServiceFor example, when a request is sent, it simply transmits the parameter data to the server method. ForAtlasCallPage MethodFor example, there will be a lot of data transmitted, and all fields in the form, includingViewstateTo the server. On the server side, it also works in the same way as normalPostBackVery similar: In thisPage MethodBefore being called, all the server controls will get their own status. That's whyPage MethodTo access the control status on the page.

Therefore, it is recommended that you usePage Method(For examplePage MethodTo access the control status on the page.Page MethodOtherwise, use as many as possibleWeb service.ProgramPerformance Improvement. UseWeb ServiceAnother benefit is to clarify the program hierarchy.

You canHttp://www.fiddlertool.com/fiddler/DownloadFiddler, A goodHTTP watcherAndDebuggerUsed to monitor the reality of the client and serverHTTPCommunication content.

Here is a sectionWeb Method, But simply returns the current time of the server.

[Webmethod]
Public Datetime getcurrentdatetime ()
{
ReturnDatetime. now;
}

Let's startWeb ServiceAndPage MethodRun this sectionWeb Method, And useFiddlerObserveHTTPCommunication content:

Web Service

Page Method

You can see thatWeb ServiceMode RuntimePostBack to the serverContent-LengthIs0AndPage MethodThe runtime is1718.

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.