The preceding example shows how to expand a detailed information table using the datatable plug-in of jQuery. In fact, the data presentation mode of. net is very good. If jQuery is used together with AJAX functions, the results are quite good. Let's take a look at this example. This has always been what I want to do.
First, the following figure is displayed:
Use northwind data. Click the plus sign to display the detailed orders of other products, and the number of orders for each product is displayed. Click '+:
First, analyze its implementation:
The first graph is displayed as a Gridview. When you click '+' in front of each record, a Web Method is called using jQuery's ajax function and the ID of the current product is transmitted, A class that inherits UserControl is defined. It can add an ascx file and define a View State field in this class.
When you click "+", use jQuery to display this ascx file in the slideshow () of the current product. How does one transmit the id? The View State is used.
There are many introductions about View State. I have never used it. Here we will briefly describe its relationship with a Web Control:
The following code is provided:
This is the product's GridView.
Then the Web Method:
Control class:
CustomerOrder. ascx code:
The ajax code that calls the Web Method is as follows: