I created a module and put a ton of functions in it and now if there is an error it won't open my Error WEB page???? it works fine if the function below is in the WEB page but when I have an error in try/catch it won't work.
I can't use session variables or Response.write or Response. anything.
So how do I open a WEB page which I am passing my Error info to to pop up?
DougP
I can't use session variables or Response.write or Response. anything.
So how do I open a WEB page which I am passing my Error info to to pop up?
Code:
here is an example of a functions Catch
Catch ex As Exception
'MsgBox(ex.ToString, MsgBoxStyle.Information, "Error")
Dim ErrorTitle As String = "Error in Module1 - sp_SOWDetermineSubmittedWeekEnd"
Dim PageName As String = System.IO.Path.GetFileName(System.Web.HttpContext.Current.Request.Url.AbsolutePath)
Dim Retval As String = ErrorTrap(PageName & " - " & System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message, ErrorTitle)
...--------------
and this is the fucntion it is calling
Private Function ErrorTrap(ByVal ModuleCameFrom, ByVal ErrorMesssage, ByVal ErrorTitle)
'Session("ErrorMSG") = ErrorMesssage
'Session("ErrorTitle") = ErrorTitle
'global vars use since Session vars won't work in a module
gblErrorMSG = ErrorMesssage
gblErrorTitle = ErrorTitle
Dim strJScript As String
strJScript = "<script language=javascript>"
strJScript += "window.showModalDialog('ErrorScreen.aspx',null,'height=400, width=700,status= no, resizable= no, scrollbars=no, toolbar=no,location=center,menubar=no, top=100, left=300');"
strJScript += "</script>"
'Response.Write(strJScript) [b][COLOR=red]>>>>> <><<< ERROR HERE [/color][/b]
' need to open ErrorTrap.aspx which displays an Error and Title
'ErrorTrap = WriteToEventLog(ModuleCameFrom, ErrorMesssage, Session("UserLastName"), Session("UserFirstName")) [b][COLOR=red]>>>>> ERROR HERE can't use session vars[/color][/b]
ErrorTrap = ""
End Function
DougP