Solved

Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation.

Posted on 2011-02-24
3
785 Views
Last Modified: 2012-05-11
The following code:

         MsgBox("Please select a name before saving the lock settings", vbInformation)

Produces the following error on a web page.  

"Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application."

I did a little research and found suggestions stating that MsgBox is intended solely for Windows forms.  If that's the case, how do I properly call a message box from a web page?
0
Comment
Question by:jdana
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 250 total points
ID: 34974509
Yes msgbox is for windows forms only as technically you don't have an 'interactive' gui with asp.net. The most common way of doing this would be using javascript to display and alert but it would help if you posted some code so we could see what you were trying to achieve
0
 
LVL 29

Assisted Solution

by:Paul Jackson
Paul Jackson earned 250 total points
ID: 34974859
Here's some example code :

            Dim strScript As String = "<script language=JavaScript>alert('" & strMessage & "')</script>"
            Dim cs As ClientScriptManager = aspxPage.ClientScript
            If (Not cs.IsStartupScriptRegistered(strKey)) Then
                cs.RegisterStartupScript(aspxPage.GetType(), strKey, strScript)
            End If

Open in new window

0
 

Author Closing Comment

by:jdana
ID: 35036500
Perfect.  Thanks!
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

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

914 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

17 Experts available now in Live!

Get 1:1 Help Now