Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2006, 12:41 AM
Registered User
 
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default messagebox.show

hi,


how to generate messagebox.show in asp.net


bye.

 
Old October 10th, 2006, 03:55 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts
Default

bikki:
More information is needed. It is not clear what you are trying to accomplish, especially if the TextBox Message Visibility depends on some condition. It would also be helpful if you show your existing code so far.
 
Old October 10th, 2006, 06:35 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

MessageBox.Show is contained in System.Windows.Forms and is desinged for platform applications, use javascript alert().

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
 
Old March 20th, 2008, 04:26 AM
Registered User
 
Join Date: Mar 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ScepterMT Send a message via Yahoo to ScepterMT
Default

The best way I've found to do this is to create a static class MessageBox with a static method Show(), which will give you the ablility to to still use the syntax MessageBox.Show("Your Message"); and convert it into window.alert("Your Message");.

The javascript alert() function is limited as it doesn't provide any overloads for changing the caption of the MessageBox, but it still works nicely.

I've written a how to on my blog at: http://sceptermt.blogspot.com/2008/0...lass-in-c.html that shows the source code that I used in C# for my web application and details on how it works.

You could also write overloads for the static show() method to allow the class to do a javascript confirm() or a prompt(). I haven't needed that functionality yet so I've just kept it simple.

Check This out: http://www.sceptermarketingtechnologies.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using messagebox.show() leion General .NET 17 March 20th, 2008 01:39 AM
MessageBox.Show() jyoti_khera General .NET 2 November 23rd, 2004 06:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.