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 !!