After Ajax Association

Source: Internet
Author: User

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.

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.