View Single Post
  #6 (permalink)  
Old April 8th, 2010, 05:41 PM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

So with the debugger enabled its gonna keep trace of error inside the IDE and without it enabled it gonna execute in the browser. I am right ?
Both options do a compilation, and thus any compile time errors (syntax errors and so on) are shown in Visual Studio before you're even able to run the page in the browser. However the behavior for the BasePage should indeed result in a runtime, and not a compile time error.

What you may be seeing is that Visual Studio breaks into your code when you debug (by using F5), showing you the line that throws the error. This is normal behavior (and very useful when tracking down bugs). When you then press F5 again, you should see the error message appear in the browser. When using Ctrl+F5, you will see the error in the browser directly. It's still being caused by a run-time error at the server (e.g. the browser just displays the error message), but Visual Studio doesn't intercept it, and doesn't show you where the error occurred.

Does this help?

Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Rushino (April 8th, 2010)