Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to write some result to console in ASP.Net (C#).
It works in Window Application, but Web Application not work.
Here are what I have tried:
C#
protected void btonClick_Click(object sender, EventArgs e)
{
    Console.WriteLine("You click me ...................");
    System.Diagnostics.Debug.WriteLine("You click me ..................");
    System.Diagnostics.Trace.WriteLine("You click me ..................");
}

But I see nothing in Output panel.
I am using Visual Studio 2010.
Please help me how to solve this problem?
Posted
Updated 7-Mar-12 20:50pm
v3

Console application and ASP.NET application are different type of applications and you can not write to Console from an ASP.NET application. If you want to write to the OutPut window use Debug.Write or Debug.WriteLine methods. To use Debug class you have to import name space System.Diagnostics
 
Share this answer
 
v2
Comments
Bun Leap_kh 8-Mar-12 4:30am    
I already tried in my question.
 
Share this answer
 
Comments
ProEnggSoft 8-Mar-12 19:13pm    
Good link to know about Tracing in ASP.NET. My 5
[no name] 8-Mar-12 19:15pm    
Thanks
See similar[^] problem.
 
Share this answer
 
Comments
Bun Leap_kh 8-Mar-12 2:28am    
That's no solution!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900