redirect to a page if response.redirect fails
I have a response.redirect(url)
which goes to another site.
- The request is being sent from the code behind an aspx page.
- 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.
精彩评论