Modify web.config as
<customErrors mode='On' defaultRedirect='errorpage.aspx' />
The <customErrors> configuration section supports an inner <error> tag that associates HTTP status codes with custom error pages. For example:
<customErrors mode='On' defaultRedirect='genericerror.htm'>
<error statusCode='404' redirect='pagenotfound.aspx'/>
<error statusCode='403' redirect='noaccess.aspx'/>
</customErrors>
For more details refer <customErrors> Element
Share with