How to display messagebox in asp.net VB class

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
itgirl7Asked:
Who is Participating?
 
Deepak LakkadConnect With a Mentor Commented:
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
 
nandithaaCommented:
Try this:
System.Web.HttpContext.Current.Response.Write("<script>alert('" + ex.Message & "')</script>")

Open in new window

0
 
OP_ZaharinCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.