ASP. NET div information prompt box hidden after several seconds

Source: Internet
Author: User

In the old system today, the user requested that a javascript alert message prompt should be changed to a Div tag for display. When it is displayed, it will only be displayed for a few seconds and then hidden, in this way, you do not need to click OK in the alert information box or close the button.

The following Insus. NET provides a simple example based on the implemented functions. The problems encountered in the implementation process are also analyzed and shared together.

First, create a xxx. aspx webpage on the asp.net Website:


Step 1: Create a div tag and add a Label control to it to display relevant information.
Step 2: Add a style.

 

Step 3: Add html markup, A TextBox and a Button in the aspx webpage, and Click the Button in code behind:

 

Now return to the html markup of aspx and add the jQuery code:

 

Step 5: reference the jQeury class library.

Step 6: Hide the Div tag three seconds after it is displayed.


Real-time operation and Demonstration:

 


Before Insus. NET modifies the old system, it also tries to test OK in this way and then move it to the old system to be modified, but there is no effect at runtime:


The message prompts the set time. The Div is not hidden and the effect is lost, as shown below:




The final check. In the old system, it was included in UpdatePanel. As a result, the functions and effects of the Application disappear. How can this problem be solved? Check msdn:

Http://msdn.microsoft.com/en-us/library/bb311028 (v = vs.100). aspx

Modify the javascript jQuery code according to the msdn technical documentation:

 

 

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.