Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to display messagebox in asp.net VB class

Posted on 2011-03-23
3
Medium Priority
?
681 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
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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

782 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