0

I'm trying to create a web form using Visual Basic Net 2003 which I plan on adding a message box alerting user if they are missing data input.

If I'm not mistaken normally for the newer Visual Basic Net 2010 the code to create message box would be

messagebox.show("Insert msg here.")

There is no need to declare anything, yes? At least that is the case for VBA.

Because that is what I'm getting when I'm using 2003. It says that

messagebox is not declared

even though it is not supposed to be a variable. What is supposed to be the correct method to create message box in VB Net 2003?

hjh93
  • 570
  • 11
  • 27
  • 3
    You are mistaken. `MessageBox.Show` is code that is used in Windows Forms and WPF, where there is a `MessageBox` class. It's not dependent on the VB version (other than WPF didn't exist until VB 2008). There's still no `MessageBox` class in Web Forms in VB 2017 or the unreleased VB 2019. You generally use a JavaScript library of some sort to display dialogues in ASP.NET applications. – jmcilhinney Feb 04 '19 at 01:22
  • 1
    I don't believe the MessageBox is available in webforms. MessageBox is for Windows.Forms applications. I think there is a javascript alert that can run on the client, – Mary Feb 04 '19 at 01:25
  • I see. Then I'll just have to work around that with a label then. Thanks. – hjh93 Feb 04 '19 at 01:39
  • Check [this](https://stackoverflow.com/questions/9720143/asp-net-web-application-message-box/9720205#) out. – preciousbetine Feb 04 '19 at 05:33

0 Answers0