I have a error page, so that whenever there is a server error I redirect the page to error.aspx. So when I tested it by removing a parameter from the code, the code fails and it should redirect to error.aspx instead it is still showing the server error in the same page. How should I redirect the page when there is a server error. I have the custom error in my web config
Server Error in '/' Application.
The MySqlParameterCollection only accepts non-null MySqlParameter type objects.
Parameter name: value
<customErrors mode="RemoteOnly" redirectMode="ResponseRewrite" defaultRedirect="error.aspx">
</customErrors>
I have a datalayer where all the db queries are done.