how come nothing shows up in debug window?

R

Rich

Hi,

I am just starting out writing code for asp.net and in particular C#
(transitioning from years of vb.net). I am using a commercial assembly in
this asp.net app (which just I inherited) and am using a treeview control
(which is named HierarchyTree) which is part of the assembly
(ComponentArt.Web.UI.TreeView). The treeview looks nice on my webform, but I
am having a problem adding event code. I added the control to a content
section <asp content1..> and some div tags and a splitter control (also from
component art). So I can't see the control in the design view of my webform
(the app also has a master page, but I added the treeview control to
Default.aspx). I was able to add nodes and text to the nodes. This is what
I am trying to display in the debug window on page load. I can step through
the code and it does go into the foreach loop. But nothing displays in the
debug window (output window). Any suggestions why this is happening? Does
the debug window work in asp.net? While I am at it, how to set up events for
this control? Usually I can double click on the event I need in the
lightening rod in the property sheet in Design view, but I can't get to that
property sheet since I can't see the control in design view - but the
treeview does show up when I run the application (also in the aspx html
source view). Any suggestions appreciated how to get this treeview control
going (events and so forth).

public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Console.WriteLine("testing");
int i = 1;
foreach (ComponentArt.Web.UI.TreeViewNode tn in
HierarchyTree.Nodes)
{
Console.WriteLine(i.ToString() + ") " + tn.Text);
i++;
}
}
}

Thanks,
Rich
 
M

Mythran

Rich said:
Hi,

I am just starting out writing code for asp.net and in particular C#
(transitioning from years of vb.net). I am using a commercial assembly in
this asp.net app (which just I inherited) and am using a treeview control
(which is named HierarchyTree) which is part of the assembly
(ComponentArt.Web.UI.TreeView). The treeview looks nice on my webform,
but I
am having a problem adding event code. I added the control to a content
section <asp content1..> and some div tags and a splitter control (also
from
component art). So I can't see the control in the design view of my
webform
(the app also has a master page, but I added the treeview control to
Default.aspx). I was able to add nodes and text to the nodes. This is
what
I am trying to display in the debug window on page load. I can step
through
the code and it does go into the foreach loop. But nothing displays in
the
debug window (output window). Any suggestions why this is happening?
Does
the debug window work in asp.net? While I am at it, how to set up events
for
this control? Usually I can double click on the event I need in the
lightening rod in the property sheet in Design view, but I can't get to
that
property sheet since I can't see the control in design view - but the
treeview does show up when I run the application (also in the aspx html
source view). Any suggestions appreciated how to get this treeview
control
going (events and so forth).

public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Console.WriteLine("testing");
int i = 1;
foreach (ComponentArt.Web.UI.TreeViewNode tn in
HierarchyTree.Nodes)
{
Console.WriteLine(i.ToString() + ") " + tn.Text);
i++;
}
}
}

Thanks,
Rich

* Console.WriteLine does NOT write to the debug window. All of the Console
class properties and methods affect the Console window...since you are
dealing with a web application, there is no Console window. (A Console
window is the window created as part of a Console application or the hosting
command prompt window when ran on the command-line).

The class that you should be using for this functionality is the Debug class
under the System.Diagnostics namespace.

Example:

Debug.WriteLine("testing");

HTH,
Mythran
 
J

Jeff Johnson

I am just starting out writing code for asp.net and in particular C#
(transitioning from years of vb.net).

In truth this has nothing to do with the language and everything to do with
the platform (ASP.NET). I recommend you re-post this question in an ASP.NET
group. I know there's a way to turn on debugging (it either displays on the
page itself or is a separate, specially-named page you can access), but I
can't remember off the top of my head how it's done since I'm not much of a
Web guy.
 
M

Mythran

Jeff Johnson said:
In truth this has nothing to do with the language and everything to do
with the platform (ASP.NET). I recommend you re-post this question in an
ASP.NET group. I know there's a way to turn on debugging (it either
displays on the page itself or is a separate, specially-named page you can
access), but I can't remember off the top of my head how it's done since
I'm not much of a Web guy.

I know it's a little late but...

what you were talking about is called tracing...

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top