PostBack or not?

Source: Internet
Author: User

I just arrived at the company today and got onto MSN Messenger. Before I had time, I sent a Message and asked me a question, which is roughly like this: data needs to be bound to two dropdownlists (the data comes from the background database). The data in the two Dropdown lists is one-to-many, that is, when Dropdown1 is selected, different data will always appear in the corresponding Dropdown2, is it very simple and common application? The first thing that comes to mind is when Dropdown1's Selectchanged, PostBack, to get the corresponding data from the database and bind it to Dropdown2, the second Message is coming. It cannot be PostBack! I haven't written the specific code for a while. I thought about it. OK. Since PostBack is not available, I can save the data to the client during PageLoad and implement it through Javascript, how can I save the data to the client? I personally think that because Dropdown1 corresponds to the data in Dropdown2, we can consider using one-dimensional arrays and multi-dimensional arrays in Javascript. Download the specific code here

. The PostBack mechanism in the NET platform does bring great convenience to our development, but sometimes we should try to reduce unnecessary PostBack as much as possible, considering the problem of network speed (although it has entered the broadband era ), after page PostBack, users often need to wait for a while before loading the page. This is very intolerable for this customer. Therefore, during development, do not simply put all the functions in the server segment to run, consider as much as possible, and then make the best choice in the server segment and client.

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.