Reputation: 1
this is my button click sub
Protected Sub abc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsavecurrent.Click
Try
If Not Page.IsValid Then Exit Sub
Saveabc()
Response.Redirect("abc.aspx")
Catch exab As Threading.ThreadAbortException
Catch ex As Exception
ReportError(ex, Session, Request)
End Try
End Sub
after going to response.redirect, it moves to next line of ThreadAbortException and doesnt goto the abc.aspx. it just says session expired. how do i make it goto the abc.aspx?
Upvotes: 0
Views: 1933
Reputation: 21141
Its the way Response.Redirect is implemented, Response.End generates a ThreadAbortException for notifying the processing engine.
This article has a work around for solving this. In general you probably don't want to catch ThreadAbortException if you are doing a Redirect.
I believe this is also documented in MSDN as well.
Upvotes: 1