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
772 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
Comment Utility
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
Comment Utility
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
Comment Utility
Perfect.  Thanks!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
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: …

771 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

14 Experts available now in Live!

Get 1:1 Help Now