Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: IIS7 ASP.NET VB.NET
could anyone help me. I am building web application using vb .net 2008.
 
when I debug using the common complier it can show the Message box, but when I use IIS server the message box can't be shown and cause error page.
 
the error page say:"
 
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."
 
is there any setting need to be done to solve this case?
 

 
Thanks,
Posted 10-Apr-13 20:09pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello Archit,
 
You should not be using MessageBox in a web application. It won't show up. The error message explains it prtty clearly. So remove the MessageBox.
 
Regards,
  Permalink  
v2
Comments
Archit Patel at 11-Apr-13 2:13am
   
ok i got it
 
but if messagebox not work in web app. than why compiler support it ?
Prasad Khandekar at 11-Apr-13 2:55am
   
I guess it will be unwise to build such functionality in a language compiler. A .cs or .vb file does not carry information about it's usage.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
 
You can use javascript message boxes in IIS. Refer the code below:
 
Dim sb As New System.Text.StringBuilder()
            sb.Append("<script type = 'text/javascript'>")
            sb.Append("window.onload=function(){")
            sb.Append("alert('")
            sb.Append(ex.Message)
            sb.Append("')};")
            sb.Append("</script>")
            ClientScript.RegisterClientScriptBlock(Me.GetType(), "alert", sb.ToString())
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 192
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,077
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100