WorldofASP.NET : ASP.NET Tutorial, Hosting, and Source Code
You are 1 of 275 users

Product SpotLight Hosting SpotLight

Displaying a Message in Response to Some Action and Then Hiding It on Subsequent Postbacks

Blogger : 4GuysFromRolla.com Headlines
All posts : All posts by 4GuysFromRolla.com Headlines
Category : ASP.NET
Blogged date : 2008 Aug 06

ASP.NET web pages commonly display messages in response to user actions. For instance, a typical CRUD (Create, Read, Update, Delete) web page might display the message, "Record deleted" immediately after deleting a record and the message "Record updated" immediately after updating a record. Likewise, there would be messages displayed for inserting a new record and messages displayed in the event of an error. Such messages are typically displayed using a single Label Web control. This control may be located at the top of the page and have its Text property initially set to empty string. Then, when particular events transpire, the Label's Text property is updated accordingly.

The problem with this approach is that the Label's Text property value is remembered across postbacks. Consequently, if a user deletes a record the "Record deleted" message is displayed. If the user next sorts or pages the CRUD grid or perform some other action that results in a postback, the Label control continues to display the message "Record deleted," which is now outdated. What we want is to have the Label's Text property revert to an empty string on subsequent postbacks.

There are two simple and straightforward techniques at our disposal for implementing such functionality. This article examines these two approaches and includes a working demo available for download that highlights both approaches. Read on to learn more!
Read More >


Read comments or post a reply to : Displaying a Message in Response to Some Action and Then Hiding It on Subsequent Postbacks
Page 33 of 1589
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | FREE ASP.NET CMS | Phone Card | PHP Directory | Bangkok Hotels |Calling Card