Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 March 28th, 2004, 11:57 PM
Authorized User
 
Join Date: Mar 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using messagebox.show()

I'm trying to use messagebox.show(). but i get an error message like this during the implementation

BC30451: Name 'MessageBox' is not declared.

the code is very simple...

<%@ Page Language="VB" debug="true"%>
<script runat="server">

sub button_click(sender as object, e as eventargs)
     MessageBox.Show("The Username or Password is incorrect", "Invalid Username or Password", _
     MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk)

end sub
</script>

<html>
<head>
<title>Test messagebox.show()</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>

<form runat="server">
    <asp:button runat="server" id="mybutton" OnClick="button_click"/>
</form>

</body>
</html>


_________________
can anybody tells me what is happening? i've tried to find it out through the internet but unfortunately can't get any answer. any help will be appreciated.

 
Old March 29th, 2004, 10:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Unfortunately you can't use MessageBox in ASP.NET. It is only for Windows Forms.

Check this topic for more info:

http://p2p.wrox.com/topic.asp?TOPIC_ID=9675


 
Old March 29th, 2004, 11:43 AM
Authorized User
 
Join Date: Mar 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the information that you supply...

 
Old April 20th, 2004, 06:07 AM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
i have used messagebox in asp.net.

1st add the reference system.windows.forms.dll
then in coding part(.vb)type

imports system.windows

then in button click event type

system.windows.forms.Messagebox.show(.....

when u click the button u will get a message box. try this one this can help u

regards
sriram



 
Old April 20th, 2004, 10:03 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by sriram s
i have used messagebox in asp.net.
And have you yet tried to run the asp.net application from a browser on a machine OTHER than the server??? The code that is running that fires off the message box is running on the server. What good does that do you when the users are not sitting at the server? There is a very good reason that the System.Web namespace does not have MessageBox functionality.

Peter
-------------------------
Work smarter, not harder
 
Old April 20th, 2004, 10:50 PM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by planoie

And have you yet tried to run the asp.net application from a browser on a machine OTHER than the server??? The code that is running that fires off the message box is running on the server. What good does that do you when the users are not sitting at the server? There is a very good reason that the System.Web namespace does not have MessageBox functionality.

Peter
-------------------------
Work smarter, not harder
hi

yes i know that. But in previous post it is given that it is not possible to use message box in asp.net.For that i post this one.
But still we can make use of java script to achieve this.

regards
sriram

 
Old April 21st, 2004, 06:21 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Ok, so you got me on sematics. Sure, it might be technically possible, but it's not very practical. In the end, with the intended use of a web application, it's not possible in practice.
 
Old April 21st, 2004, 06:46 AM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

I have tried that and found it working for our project.






 
Old April 21st, 2004, 09:13 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Now you have my curiosity. Can you show me an example of where you use system.windows.forms.Messagebox.show in an ASP.net application? Perhaps you have a link to a page that uses it that you could share. I would very much like to see it.
 
Old April 21st, 2004, 09:21 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Does this help?

http://www.chez.com/scribe/en/dotnet/dotnet.htm

HTH,

Snib

<><





Similar Threads
Thread Thread Starter Forum Replies Last Post
messagebox.show bikki_suresh ASP.NET 1.0 and 1.1 Basics 3 March 20th, 2008 04:26 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.