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 

Published Thursday, October 02, 2008 10:59 PM by nawaf.albadia
Filed under: , , ,

Comments

# re: Display a Nice Error Popup Window

Thursday, October 02, 2008 10:32 PM by Webdiyer

Sorry but where's the attachment?

# re: Display a Nice Error Popup Window

Thursday, October 02, 2008 10:43 PM by Webdiyer

Sorry,I find it!

# re: Display a Nice Error Popup Window

Friday, October 03, 2008 3:00 AM by AKS

thanks.

# re: Display a Nice Error Popup Window

Friday, October 03, 2008 5:35 AM by nawaf.albadia

Hi Webdiyer,

It's there mate. look under the statement "Hope this helps" can not you see it!!

Good luck

# re: Display a Nice Error Popup Window

Friday, October 03, 2008 10:40 AM by jstengel

Nice! I was just preparing to "roll my own" for something similar, and this should save me some time. Thanks for sharing.

# re: Display a Nice Error Popup Window

Friday, October 03, 2008 5:26 PM by nawaf.albadia

Hi Joshua Stengel,

I'm very glad you find it useful :)

# Display a Nice Error Popup Window - Extended

Friday, November 28, 2008 7:14 AM by Nawaf's Blog

Last time I blogged about how to display a nice error message to the user using only one line of declarative

# ?????????? ?????? ???? AJAX &laquo; ????????

Saturday, March 28, 2009 2:51 PM by ?????????? ?????? ???? AJAX « ????????

Pingback from  ?????????? ?????? ???? AJAX &laquo; ????????

# re: Display a Nice Error Popup Window

Tuesday, May 05, 2009 8:14 AM by vengadeshkannappan

web.config

Add this assembly code

<pages>

<controls>

<add tagPrefix="nw" namespace="ErrorPopup" assembly="ErrorPopup"/>

</controls>

</pages>

# re: Display a Nice Error Popup Window

Monday, June 15, 2009 6:03 PM by bill witt

Thank you for sharing! Nice, easy to use control.

It is great that folks like you take the time to help the rest of us!

Bill

Leave a Comment

(required) 
(required) 
(optional)
(required)