Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我用 asp.net 和 c#.net 开发了一个 web 应用程序,我使用 sql server DB,
我偶尔会遇到 sql 超时异常,我想在 sqltimeout 异常的情况下重定向到登录页面?怎么做
将数据库调用包装在 try/catch 中。如果超时,请使用该Response.Redirect()命令。
Response.Redirect()