Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Unable to display Message Box in ASP.NET using VB.NET

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 16-06-2009
Member
 
Join Date: Apr 2008
Posts: 242
Unable to display Message Box in ASP.NET using VB.NET
  

The MessageBox class is a class that displays a MessageBox on the machine on
which the application is running. An ASP.Net application runs on a server, When moving from Windows Forms to ASP.NET Web Forms, an API that may be missed is that offered by the System.Windows.Forms.MessageBox Class. How do i create one form in ASP.NET using VB in that how to show message box after clicking a button. In order to alert the user we need to inject some client side code into the HTML page. This is a simple task but can become quite a nuisance if this functionality is required on a regular basis.

Reply With Quote
  #2  
Old 16-06-2009
Member
 
Join Date: Jan 2006
Posts: 211
Re: Unable to display Message Box in ASP.NET using VB.NET

The code which you will be created that you need to added to the HTML of the page sent to the client. You could add such a script using.

Page.RegisterStartupScript(). Example:
Dim strScript As String
strScript = "<script type=""text/javascript"">alert('This is the testing application')</script>"
If Not Page.IsStartupScriptRegistered("MyScript") Then
Page.RegisterStartupScript("MyScript", strScript)
End If

This is the reason why we store the Queue in a Hashtable, because we are using static methods. There is the potential for multiple pages to be using the class at the same time (on separate threads).
Reply With Quote
  #3  
Old 16-06-2009
Member
 
Join Date: Oct 2008
Posts: 65
Re: Unable to display Message Box in ASP.NET using VB.NET

MsgBox is located in System.Windows namespace, but ASP.Net is located in System.Web namespace.There is the potential for multiple pages to be using the class at the same time (on separate threads). So the environment will be different. But, If you could run it, please show to me how to configure your IIS.Forms namespace is usable only from Windows Forms and NOT ASP.NET Web Forms. In order to alert the user we need to inject some client side code into the HTML page.
Reply With Quote
  #4  
Old 16-06-2009
Member
 
Join Date: Jan 2009
Posts: 143
Re: Unable to display Message Box in ASP.NET using VB.NET

Using JavaScript, you can access the dialog boxes while on page loading or after rendering the page content to the browser. There is no way to get a confirmation from the user while you process the functionality through JavaScript. To accomplish this you have to go for a server side message box.

The following code will allow you to create web form code behind, add the following line of code:

In VB.NET

Code:
Imports NewMsgBoxAsp.Holool.Anwar.Web.Controls.UI
The following line Creates an instance of MessageBox class, to access its properties and methods:
VB.NET

Code:
Dim NBox As MessageBox = New MessageBox
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Unable to display Message Box in ASP.NET using VB.NET"
Thread Thread Starter Forum Replies Last Post
Message storing location keeps changing and unable to view message in LG optimus 2x Dvimidha Portable Devices 4 20-08-2011 07:13 PM
Nokia E7 is unable to display any new message Tees Mar KH Portable Devices 4 11-04-2011 06:26 AM
"Windows unable to find display device" error message in windows vista Lopazax98 Operating Systems 4 09-02-2011 06:52 PM
Need code to display message box in C++ amadeo Software Development 3 10-07-2009 06:23 PM
Display own Custom Message on Startup Orlando Customize Desktop 1 02-03-2009 05:16 PM


All times are GMT +5.5. The time now is 05:38 PM.