Hi all,
Well here is the way I settled for:
In my web.config file I added the following:
----------------------------------------------------------------------------
<customErrors mode="remoteOnly" defaultRedirect="error.aspx" />
<!-- You can configure the custom errors to be On, Off, or RemoteOnly. On
means everyone sees it. Off means no one sees the custom errors.
RemoteOnly means that any off the box will see the custom error page and
anyone on the box will see the real stack trace. -->
<error statusCode="404" redirect="NotFound.aspx" />
<error statusCode="403" redirect="AccessNotAllowed.aspx" />
<error statusCode="500" redirect="InternalError.aspx" />
<!-- etc... -->
----------------------------------------------------------------------------
I am sure you'll love this feature... Particularly the first line:
customErrors
Yama Kamyar
"Yama" <yk*****@grandpacificresorts.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
How can I redirect to an error page from a component vb.net?
Public Class bo
Protected Friend Function CreateString(ByRef lst As ListBox) As String
dim s As String
Try
s = "Hello World"
' create a new dataset
Catch ex As Exception
' How can I use Response.Redirect("page.aspx") from here???
Trace.Write(ex.Message)
Finally
End Try
Return s
End Function
End Class
Thanks,
Yama