Pass the Page in...as a parameter
public function HandleException ( ex as Exception , p as Page )
// public void HandleException (Exception ex, Page p)
{
p.Response.Write(ex.Message)
'or
p.Response.Redirect(
http://www.microsoft.com)
}
on any code behind of the aspx page
try
catch
HandleException( ex , this.Page )
pseudo code, but you get the idea.
"Nam" <Na*@discussions.microsoft.comwrote in message
news:B9**********************************@microsof t.com...
Using Response.Redirect("error.htm") in the catch block of a try-catch
statement, I am redirecting a page to a generic page if an error occurs in
code-behind of the page.
Since Response.Redirect cannot be used in a class module, how can I
redirect
a user to error.htm from the catch block of a try-catch statement in a
class,
say, myClass if an error occurs in myClass?
Thank you,
Nam