Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 28th, 2004, 11:57 PM
Authorized User
 
Join Date: Mar 2004
Location: Rawang, Selangor, Malaysia.
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.

Reply With Quote
  #2 (permalink)  
Old March 29th, 2004, 10:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
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


Reply With Quote
  #3 (permalink)  
Old March 29th, 2004, 11:43 AM
Authorized User
 
Join Date: Mar 2004
Location: Rawang, Selangor, Malaysia.
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the information that you supply...

Reply With Quote
  #4 (permalink)  
Old April 20th, 2004, 06:07 AM
Registered User
 
Join Date: Apr 2004
Location: chennai, tamil nadu, India.
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



Reply With Quote
  #5 (permalink)  
Old April 20th, 2004, 10:03 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
Reply With Quote
  #6 (permalink)  
Old April 20th, 2004, 10:50 PM
Registered User
 
Join Date: Apr 2004
Location: chennai, tamil nadu, India.
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

Reply With Quote
  #7 (permalink)  
Old April 21st, 2004, 06:21 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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.
Reply With Quote
  #8 (permalink)  
Old April 21st, 2004, 06:46 AM
Registered User
 
Join Date: Apr 2004
Location: chennai, tamil nadu, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

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






Reply With Quote
  #9 (permalink)  
Old April 21st, 2004, 09:13 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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.
Reply With Quote
  #10 (permalink)  
Old April 21st, 2004, 09:21 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
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

<><
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:31 AM.


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