Solved

How can I send Visual Basic error message to user over internet? MsgBox doesn't Work!

Posted on 2007-11-14
4
238 Views
Last Modified: 2012-08-13
I have developed a user registration system to be used over the internet. It is written in MS VB using MS visual Web Developer. I used MsgBox to send various messages to the user. This worked fine as long as I was in development mode using Ctrl F5 to execute the programs but, when I try to test over the internet, I can't get MsgBox to work. What should I use to send information messages back to the user over the internet?????? The messages are simple such as "Update Successful" and the user needs to know but, I am at a loss for a simple method to send the messages.
0
Comment
Question by:djc916
4 Comments
 
LVL 2

Expert Comment

by:talspaugh27
ID: 20280881
the best way I have always found is to put a javascript function on the page that simply takes in a string and shoots off an alert box containing the string parameter, when it is called so that you can cause it to fire off from the code behind the page.


HTH
Tbone
0
 
LVL 1

Accepted Solution

by:
straucha earned 500 total points
ID: 20291797
'Code
           Dim strmessage2 As String
            strmessage2 = "Please select a Date first"
            'Call separate Class, passing page reference, to register Client Script:
            CreateMessageAlert(Me, strmessage2, "strKey1")

'Seperate Class
        Public Shared Sub CreateMessageAlert(ByRef aspxPage As System.Web.UI.Page, _
                                ByVal strMessage As String, ByVal strKey As String)
            Dim strScript As String = "<script language=JavaScript>alert('" _
                                                & strMessage & "')</script>"

            If (Not aspxPage.IsStartupScriptRegistered(strKey)) Then
                aspxPage.RegisterStartupScript(strKey, strScript)
            End If
        End Sub
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20521803
Forced accept.

Computer101
EE Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now