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 :
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