怎么在程序出错时自动跳转到自定义的异常处理页面

如何在程序出错时自动跳转到自定义的错误处理页面在Web.config中配置如下:customErrorsmode RemoteOnly

如何在程序出错时自动跳转到自定义的错误处理页面
在Web.config中配置如下:
<customErrors   mode= "RemoteOnly "   defaultRedirect= "GenericErrorPage.htm ">
        <error   statusCode= "404 "   redirect= "PageNotFound.aspx "   />
</customErrors>

如果请求一个名为http://localhost/manual/UserInfo.aspx   ,但在IE地址栏中却输入成http://localhost/manual/UserInfo1.aspx。请问如何进行其它设置才能自动跳转到自定义的错误页面呢?

[解决办法]
<customErrors mode= "on " .../>