Examples of Ajax practical linkage Based on summary of recent project knowledge points-(Article 1)

Source: Internet
Author: User
With regard to association, some web projects in. Net often use autopostback = "true" and trigger events to achieve the effect. In recent projects, Ajax plays a crucial role due to the design requirements and the adoption of non-refreshing effects.

The following describes how to use the linkage effect in the drop-down box:

1. I use the ajaxcontroltoolkit provided by Ms. The reference operation is not detailed. If you need to write it, leave a message!

2. The controls used are: 4. selectkpbm in backend CS is also very simple.

// You must add this method header and use the public static method, because this method needs to be called at the front end. [Webmethod]
Public static string [] selectkpbm (string str1)
{
# Region method function: extracts the corresponding records from the session dataset performancejgszdata based on the primary key str1.split (',') [0], and then returns information about other fields of the corresponding records.
Injcgjbussinessserviceref. jgszdata. jgszdatatable jdt = new bhblmssystemweb. injcgjbussinessserviceref. jgszdata. jgszdatatable ();
Datarow DR = performancejgszdata. Tables [0]. Rows. Find (str1.split (',') [0]);
String [] result = new string [4];
If (Dr! = NULL)
{
Result [0] = getcsmc (Dr [jdt. szcscolumn. columnname]. tostring ());
Result [1] = Dr [jdt. szcscolumn. columnname]. tostring ();
}
Else
{
Result [0] = "";
Result [1] = "";
}
Result [2] = str1.split (',') [1];
Result [3] = str1.split (',') [2];
Return result;
# Endregion
}

The general method has been completed here. This is the simplest use of Ajax. It may be helpful for beginners to knock on the door. I am also a newbie and everyone can learn it together !!

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.