Click here to Skip to main content
11,640,445 members (62,931 online)
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 CPallini 239
1 Suvendu Shekhar Giri 215
2 Mika Wendelius 210
3 OriginalGriff 165
4 Sergey Alexandrovich Kryukov 139


Advertise | Privacy | Mobile
Web01 | 2.8.150731.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2015
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