开发者

redirect to a page if response.redirect fails

I have a response.redirect(url) which goes to another site.

In the event this fails, how should I redirect again to a redirect fail page?

  1. The request is being sent from the code behind an aspx page.
  2. I have an httpm开发者_运维知识库odule in place. Can it be used?


response.redirect(url) tells browser to request the "url" so you can not control if this url call is failed in browser.

What you can do is do a HTTP GET HEAD to that url first to see if you get http 200 response and then do a response.redirect(url).


This doesn't make much sense - if a redirect fails, how will the server ever find out?

A redirect tells the browser to go to a different page - if this fails, it fails on the browser and the server has no way to know about it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜