当我使用Response.Redirect(…)将我的表单重定向到一个新页面时,我得到了错误:
类型为'System.Threading '的第一次机会异常。mscorlib.dll中出现ThreadAbortException ` System.Threading类型的异常。在mscorlib.dll中出现ThreadAbortException',但在用户代码中没有处理
我对此的理解是,该错误是由web服务器中止余下的页面响应引起的。重定向被调用。
I know I can add a second parameter to Response.Redirect that is called endResponse. If I set endResponse to True I still get the error but if I set it to False then I do not. I am pretty sure though that that means the webserver is running the rest of the page I redirected away from. Which would seem to be inefficient to say the least. Is there a better way to do this? Something other than Response.Redirect or is there a way to force the old page to stop loading where I will not get a ThreadAbortException?