HardCode Posted September 13, 2004 Posted September 13, 2004 I am confused about why, when I uncomment the Response.Redirect in the Catch, the page always .Redirects to "autherror.aspx". If it is commented, the page works fine! Is a .Redirect allowed in a Catch? If not, why does it .Redirect to that page every time when uncommented! Try ' Code that works and redirects to appropriate page ' based on a series of checks Catch e As Exception 'Response.Redirect("autherror.aspx") Finally oConn.Close End Try Quote
*Gurus* Derek Stone Posted September 13, 2004 *Gurus* Posted September 13, 2004 An exception is being thrown. That simple. Quote Posting Guidelines
HardCode Posted September 13, 2004 Author Posted September 13, 2004 I don't believe so, because if I comment out the lines: Try, Catch, Finally, End Try there is no error on the page. Since I use Web Matrix, I use the "technique" of commenting out the error handling to see any errors in the web browser (debug="true" is set). When I do so now, there is no error. That is why it is confusing me. It seems the parser just doesn't like that one .Redirect in the Catch !?! Quote
Arch4ngel Posted September 13, 2004 Posted September 13, 2004 If you have a Try Catch Finally ... there won't be any error shown in the browser. My advice.... -Insert Response.Write(e.Message) inside your Catch. -Put a break point in the beginning of you try and do a step-to-step until it goes out of your try and goes right into the catch. When did it goes out ? Catch shall be called only when there's an Exception thrown. And Finally is always called. Tell me more on your problem. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
HardCode Posted September 13, 2004 Author Posted September 13, 2004 If you have a Try Catch Finally ... there won't be any error shown in the browser. Yes, that why I commented them out and still received no error. :) I am using Web Matrix so I cannot step through :( ... UNLESS, you can help me with the other thread I posted about VS.NET 2003 + IIS with that "...IIS is not running ASP.NET 1.1" error! :) Quote
Arch4ngel Posted September 13, 2004 Posted September 13, 2004 That's why I said to insert a Response.Write(e.Message) inside the Catch section and to leave your Redirect commented. Tell us the error that is shown. Thank you Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Administrators PlausiblyDamp Posted September 13, 2004 Administrators Posted September 13, 2004 You may find http://www.xtremedotnettalk.com/showthread.php?t=87770 sheds some light on the issue. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
HardCode Posted September 14, 2004 Author Posted September 14, 2004 My other thread doesn't really explain why this code is causing the exception code to kick in. Right now, management has links to my alpha version of the web app, so I cannot try the changes. Later in the day I will add the Response.Write(e.Message) and see what it produces. Thanks! 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.