在Web.Config文件里面设置: <system.web><customErrors mode="RemoteOnly" defaultRedirect="Error/Err.htm /></system.web>