tags:

views:

204

answers:

1

I'm closing a WCF endpoint in the page_unload of an asp.net page, when using response.redirect() the page_unload event doesn't fire and i'm ending up with ophanned endpoint references.

I thought the page_unload should fire everytime.

Anyone shed any light.

Thanks

+5  A: 

Try this:

Response.Redirect(somepage, false)

When you pass true instead of false you are indicating that you wish to terminate the execution of the page. By passing false you are indicating that you wish the page to finish processing before redirecting the client.

Andrew Hare