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 is an exampleCode:
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: