Today, the Microsoft Project team encountered a problem and all the IT staff began to discuss how to solve it.
The problem is that, when the region and city are linked, select the corresponding value and query it, as shown in the following figure.
ProgramThe server control dropdownlist is used.
You may have thought that after Ajax is used, the client value has been changed, but the value stored in viewstate has not been changed, and the above error message is displayed.
I suggest you change the dropdownlist to the SELECT statement running on the server. (In fact, I am not sure it is a dropdownlist problem)
However, when an error occurs again, the correct value cannot be obtained. The obtained value is the serial number value corresponding to the first load, rather than the value after partial refresh.
My advice is to directly use request. the form object is obtained. The compiled ID is used to obtain null, that is, request. there is no corresponding value in the form set, and then the name is used. Then, the correct value is obtained ~
Therefore, when request. form is used to obtain the value, the parameter must be name rather than ID.
If you use ajax to update the drop-down box value, you still need to use this value. You cannot directly use selectvalue or value to obtain the value.