Common Problems and Solutions of ASP. NET Ajax (Atlas) [continuous update]

Source: Internet
Author: User
According to user feedback this week, ASP. NET Ajax (Atlas), from CTP to Beta 1, cannot be said to be "progress" or "regressing ". As a new version with such great changes, ASP. NET Ajax seems to be somewhat unstable. This article will list some developers Community And the corresponding solutions, and will be updated constantly, I hope to help you.

The following are two blogs (http://blogs.msdn.com/sburke/) from Shawn Burke, the director of Microsoft ).

[Method error 12031] or [method Error 500] exception occurred when calling the web method from the client.

To call the web method in a web service on a server from a client, the Web service must have Microsoft. Web. Script. Services. scriptserviceattribute Attribute: [Microsoft. Web. Script. Services. scriptservice ()]
Public   Class Myservice: system. Web. Services. WebService {
 // 
}

to call a definition from the client and the PAGE method in the page, the page method must be Microsoft. web. script. services. scriptmethodattribute Attribute Modification (of course, system. web. services. webmethod is also essential), and must be a static (static) method . A bug in the current version also results in the need to define this web method in the aspx file . definition in the CS file is useless (helpless ): script runat =" server " >
[system. web. services. webmethod]
[Microsoft. web. script. services. scriptmethod]
Public static string gethtml (string contextkey) {
//
}< br> script >

Extender control (including Ajax Control Toolkit) cannot work properly in template controls (such as login) or data-bound controls (such as gridview ).

The reason is that all client scripts in Beta 1 are managed by scriptmanager, while scriptmanager traverses the controls on the page during the prerender period and outputs the necessary client scripts, however, the content in the template is usually generated during the prerender, so that the two missed the opportunity to communicate, the client scripts required by the extender control in the natural template will not be sent to the browser, in the end, extender control cannot be used in the template control.

The solution is to force the page to generate a template control or data binding control content in the load event before the prerender, so that the scriptmanager can find them correctly during the prerender: Protected   Void Page_load ( Object Sender, eventargs E)
{
Gridview1.databind ();//The data binding control uses this

ObjectO=Login1.controls;//The template control uses this
}

Related Article

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.