Console.WriteLine() for .aspx pages

A very common tool to test and debug .NET assemblies is the implementation of the Console.WriteLine() method. With it, you can write data to Visual Studio’s Output window.

Contrary to intuition (mine, anyway), the Console.WriteLine() method does not write data to the Output window for .aspx web pages. Not to worry, though. There is an alternative:

System.Diagnostics.Debug.WriteLine();

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s