Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
866 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 1000 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

886 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