trend Posted October 2, 2005 Posted October 2, 2005 I am having this issue... I have a login form that when users post information to, it will (of course) validate the information.. and based on that information it will either: A)Response.Redirect("Access.asp") B)Response.Redirect("/NoAccess.asp") My problem is.. everytime I do a response.redirect.. My vb.net/asp.net code doesn't like it.. The thread reports "Thread was being aborted." in my logs (My response.redirects are in a try of a try/catch and the catch logs the error being "Thread was being aborted." everytime either response.redirect are executed (aka if the user is valide or is not doesn't matter). Any ideas? I don't think javascript redirects are normal for this... So should I just not worry about and not report the "Thread was being aborted." because this is normal (or is it?)? thanks! Lee Quote
Administrators PlausiblyDamp Posted October 2, 2005 Administrators Posted October 2, 2005 You will get the thread aborted exception if there is any code following your Response.Redirect, if you search these forums you should find further information on this problem. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
trend Posted October 2, 2005 Author Posted October 2, 2005 Thank you for your quick reply. Yeah, thatis what i figured :/ I was conteplating doing it like this gentelmen suggested: 'After your connection openned Dim bTest1, bTest2 as Boolean Dim pageRedirect as String pageRedirect = "default.aspx" If( Not bTest1 ) Then pageRedirect = "fail1.aspx" End If If( Not bTest2 ) Then pageRedirect = "fail1.aspx" End If 'and so on... 'Close your connection here. Response.Redirect( pageRedirect ) But if this code is in a function called by another function.. it would still case an issue, am I right? Is there a better way to do this? thanks Lee Quote
trend Posted October 2, 2005 Author Posted October 2, 2005 Hmm, my other 2 thoughts were: 1) use Server.Transfer() 2) use a timer... but could timers even be used with webpages? (well outside of javascript that is) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.