Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.



Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 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.


code :
XML
Protected Sub gvList_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles gvList.RowDeleting

        Try
            clsReportType.DeleteReportType(gvList.DataKeys(e.RowIndex).Value)

            Dim strJs As String = "<script>alert('Record Deleted Successfully..');</script>"
            ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(Page), "alert", strJs, False)
            ObjReportType.SelectCountMethod = "GetAllReportType"
            e.Cancel = True
        Catch ex As Exception
            ''MsgBox(ex.Message("Hello"))
            'Response.Write("Could not load weekly offers. ")
            'MsgBox(ex.ToString)   ' Show friendly error message.
            'Response.Write("An Exception has occurred.")
            MessageBox.Show("Report Already Exist In Report page!! So Fist Delete from Report Page")
            Response.Redirect("ReportType.aspx")
            'Response.Write("<script>window.close();</script>")

        End Try

I want to show a message when Exception is occoure but that Message is not working
and give that type of error which in mention above.
how i solve that ..plz tell my
Posted
Updated 9-Sep-11 2:45am
v3

1 solution

ASP.Net doesn't have a MessageBox class. What you want to use is a CustomValidator control in your aspx file.

Google is your friend.
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900