You have not posted any code.
Below is the code which should be passed as per your requirement.
<customerrors>
mode="RemoteOnly"
defaultRedirect="~/errors/GeneralError.aspx" /></customerrors>
The same you can achieve by adding below code in Global.asax file.
It is simple and self explanatory
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ctx As HttpContext = HttpContext.Current
Dim exception As Exception = ctx.Server.GetLastError
Dim errInfo As String = "<br>Error In : " & ctx.Request.Url.ToString() & _
"<br>Source:" & exception.Source & _
"<br>Message: " & exception.Message
ctx.Response.Write(errInfo)
ctx.Server.ClearError()
Session("value") = errInfo
System.Web.HttpContext.Current.Response.Redirect("~/GenericError.aspx")
End Sub</br></br></br></br>
I normally prefer 2nd option because you get the complete details of errors when required.
Happy Coding
[Edit]Code has been Formatted[Edit]