My toys: Use XMLHTTP to dynamically load content dropdownlist controls without refreshing

Source: Internet
Author: User

In addition to the "city", select is a dynamicdropdown control. dynamicdropdown specifies to monitor a control. When a client event of the monitored control occurs, XMLHTTP is used to send data back to the server, the request event of dynamicdropdown on the server will be triggered, and the list options can be controlled in the request event processing program. A dynamicdropdown onchange can also trigger another dynamicdropdown request event. For example, the Select in the second line will be affected by the Select in the first line.

Usage:

Set monitoredcontrol and specify the control to be monitored. That is, the PostBack of XMLHTTP is triggered by this control.

Set monitoredclientevent to specify which client event of the monitored control triggers PostBack. The default value is onchange.

When a client event specified by the monitored control is triggered, XMLHTTP is called to submit data to the page. The dynamicdropdown control triggers the request event on the server. in the request event, the sender parameter is the reference of the control, and the E parameter contains the value of the monitored control. call the additem method of the control to add list items to the control client.

You can access the text and value attributes like dropdownlist.

Demo source code

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.