The simple application of Ajax in VS2005

Source: Internet
Author: User
Tags add return string
Ajax


Ajax not to mention that we all understand, do not understand please Baidu or goo someone else than I said the professional, the author of this article is not to introduce much abstruse things, This is just a very simple example to guide everyone. This example is only to make it clear that the basic invocation of Ajax needs to do those things the author uses the VS2005 reference AJAX2.0 Assembly (Ajaxpro.2.dll).

In the Web.config file, <system.web> add the following settings




3. Create a page default.aspx

4. Register the name of the Ajax callable class in the Page_Load of the Default.aspx.cs file

protected void Page_Load (object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax (typeof (_default));
}

5. Create Ajax-Callable methods:

[Ajaxpro.ajaxmethod]
public string SETTB (string name)
{
return name;
}

Note: [Ajaxpro.ajaxmethod] is the method that defines the Ajaxpro callable, and it must be noted

6. Front Code:

<%@ Page language= "C #" autoeventwireup= "true" codefile= " Default.aspx.cs "inherits=" _default "%>

"! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">



Untitled page










Note: This is noteworthy here is _DEFAULT.SETTB (name,callback), this sentence is to invoke the _default.aspx.cs background code SETTB this method, If this method has no parameters to pass, indicate the return processing method is OK, written _DEFAULT.SETTB (callback);

Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

11.11 Big Sale for Cloud

Get Unbeatable Offers with up to 90% Off,Oct.24-Nov.13 (UTC+8)

Get It Now >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.