Controls whether the webpage Panel is displayed and the webpage panel

Source: Internet
Author: User

Controls whether the webpage Panel is displayed and the webpage panel

There are 12 Panel controls on the webpage. The default status is not displayed. The Panel controls the display based on the current month.


The following three methods are used to implement Insus. NET. First, the first method is to use the FindControl method.


The second method is to use the foreach method to find all Panel controls in the form and set the Visible value to true:


Third, because the month has 12 months. Therefore, use for 12 cycles:

The running result is as follows:

 


The display of the panel control does not work.

I think of a possibility. Maybe you put the panel in another panel.

C # How does a thread control normal display and hiding of a panel?

There is a java CountDownLatch class design to deal with this problem.
. Network does not seem to have such a class, you find it. Net CountDownLatch, and then there will be some code to simulate this class.

The principle is to define a CountDownLatch counter at the beginning. For example, if you have two subthreads and the counter is 2, when each subthread completes the execution, when the counter is between 1 and 0, the two sub-threads outside need to wait for the () method to stop the counter. In this way, when the counter reaches zero, the main thread can continue to execute it.

I am writing java code. You can refer to the example of simulating CountDownLatch on the Internet.

The final CountDownLatch lock = the new CountDownLatch (1 );

// Verify that the file server is running correctly

New topic (New Runnable ()

{

Public invalid run () method

{

StartCheck (locked );

}

}). Start Online ();

Lock. await (); wait

// Continue with the main thread
StartCheck method. If the execution is complete, you only need to call lock. countDown ;.
 

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.