Sunday, September 14, 2008 1:15 PM djsolid

ASP.NET Messagebox - Server and Client

Today I ran into an excellent post of Bill Beckelman about a server side asp.net message box.

More info you can find on this post. And I thought what if I wanted to use it via the client ? So I decided to extended a little further and to add a client-side behavior.

 

How can be used via the client?

To use the MessageBox via client you should call the
ShowMessageBox(type,Header,Text,Width,Height) function.

The first argument is the type. At the moment possible values are info,error,success and warning.
The second is the the header of the messagebox and the third is the text. You can also use html...!
The other two are width and height of the message box.

Example : ShowMessageBox('info','A Simple Header','Just some text',400,125);

So simple :)

You can view a demo or you can download the updated version.

Again credits to Bill Beckelman!

Screenshots

image.axd

image1.axd

image2.axd 

kick it on DotNetKicks.com

Filed under: , , , , , ,

Comments

# ASP.NET MessageBox Server and Client

Sunday, September 14, 2008 6:19 AM by DotNetKicks.com

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# funny wallpaper » ASP.NET Messagebox - Server and Client

Sunday, September 14, 2008 6:29 AM by funny wallpaper » ASP.NET Messagebox - Server and Client

Pingback from  funny wallpaper » ASP.NET Messagebox - Server and Client

# re: ASP.NET Messagebox - Server and Client

Sunday, September 14, 2008 1:41 PM by Bill Beckelman

Awesome job. Thanks for extending this to the client side. I just want to point out as well that Janko was the one that started this off with his post Create a Message Box User Control Using ASP.NET and CSS at www.jankoatwarpspeed.com/.../Create-MessageBox-user-control-using-ASPNET-and-CSS.aspx. Also, I need to update my post, but I have since added the following at the end of the Show method to dismiss the popup with the enter key:

ScriptManager.RegisterStartupScript(this, this.GetType(), "msgVisible",

           "function pageLoad(sender, args){if(!args.get_isPartialLoad()){$addHandler(document, 'keydown', onKeyDown);}};function onKeyDown(e){if(e && e.keyCode == Sys.UI.Key.enter){$find('" + id + "').hide();}}  ", true);

Thanks Again.

Bill

# Online Resources Galore

Thursday, October 09, 2008 2:57 AM by To Dev or not to Dev

I follow RSS feeds religiously and also at times do research on some of the work or problems I encounter

# Online Resources Galore

Wednesday, April 29, 2009 4:51 AM by Diago.co.za

Online Resources Galore

# re: ASP.NET Messagebox - Server and Client

Wednesday, June 10, 2009 11:34 AM by Ciro

he  guys  please  the link is  break i need the control please  restor the link mi mail is ciro.zamudio@femsa.com.mx thks  a lot

# re: ASP.NET Messagebox - Server and Client

Wednesday, June 10, 2009 12:25 PM by djsolid

Demo and source code updated!

Leave a Comment

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