Display a Nice Error Popup Window

I always hated web sites that show Javascript alert message to tell the user about an error. Doing so make me feel that I'm in front of desktop application and not a web app. May be the alternative is to have an error page where you redirect the user in case of any error. This definitely works fine, but sometimes it bugs me when I get redirected to that error page just because my credit card number is wrong. Of course we can use the validation controls as a standard or with AJAX support to handle that.

Anyhow, I needed to display an error message to the user as popup window, or at least this is the requirement of the project that I'm working on.

Error Popup window 


To display the above error message you just need to add

<nw:ErrorPopUp ID="ErrorWindow" runat="server" Title="Error Message" Message="Put Error Message here" Show="true"  ></nw:ErrorPopUp>

This control leverages the Modal Popup control which is part of the AJAX Controls Toolkit.  The ErrorPopup control is highly configurable in which you can change the look and feel, behavior and a lot's of things.  For example when you want to show the error message all you need to do is to set the property Show to 'true' or invoke the ShowControl() method to display the error window.

In the attachment you will find the control source-code, and demo web app. The control is written in separate DLL, all related JS, CSS styles and images are embedded in that dll so you can easily add it to your web project.

Hope this helps 

11 Comments

Comments have been disabled for this content.