Solved

How to display messagebox in asp.net VB class

Posted on 2011-03-23
3
647 Views
Last Modified: 2012-06-27
how to display message in vb.net class .I have to display message in vb.net class file.name of the file is new.vb.I want to display message in vb class file
0
Comment
Question by:itgirl7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Expert Comment

by:nandithaa
ID: 35204301
Try this:
System.Web.HttpContext.Current.Response.Write("<script>alert('" + ex.Message & "')</script>")

Open in new window

0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35204360
hi itgirl7,
first, in vb.net add reference to System.Windows.Forms.dll:
- select from the menu: "Project" then "Add Reference"
- from ".NET" tab select "System.Windows.Forms"
- press "Ok"button.

now import namespace Imports System.Windows.Forms
- add "Imports System.Windows.Forms" to the top of the class module
- then you can use Messagebox.Show() to display the messagebox
0
 
LVL 11

Accepted Solution

by:
Deepak Lakkad earned 500 total points
ID: 35204871
If you want to use messagebox in ASP.Net Application, you have to use JavaScript's Alert() function.

MessageBox will be applicable to WinForms application not for ASP.Net applications

- Deepak
0

Featured Post

Stack Overflow Podcast - Frustrating Miracles

In this podcast, Stack Overflow interviewed Linux Academy CEO/Founder, Anthony James, and got his developer story!

"Follow your passion, be prepared to work hard and sacrifice, and, above all, don't let anyone limit your dreams."  - Donovan Bailey

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month7 days, 1 hour left to enroll

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question