Is there something that prevents Response.Redirect to work inside try-catch block?

前端 未结 5 1236
旧时难觅i
旧时难觅i 2020-12-10 06:05

I got some weird error with response.redirect() and the project wasn\'t building at all.. when I removed the try-catch block that was surrounding the b

5条回答
  •  生来不讨喜
    2020-12-10 07:02

    I don't think there is any known issue here.

    You simply can't do a Redirect() inside a try/catch block because Redirect leaves the current control to another .aspx (for instance), which leaves the catch in the air (can't come back to it).

    EDIT: On the other hand, I might have had all of this figured backwards. Sorry.

提交回复
热议问题