Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Can I debug and see where I am in an website?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JB - 20 Dec 2007 11:49 GMT
I'm trying to fix a site that someone has left me and - to understate
it - it is huge!
I'm trying to work on a specific section but i can't seem to find
where the proper code for it is..

There is a menu on the main page which, when clicked brings up a
dialog box which needs filling out. I just can't find the code for
this section.
There are dozens of namespaces, hundreds of classes, and loads
of .aspx, .asax, .asmx files.
No comments or documentation available.

So since i've got remote debugging working, can I see where I am in
the site somehow? Which page/class/method has just been run?

Just to make things worse its Vis Studio 2003, .NET 1.1
Kevin Spencer - 20 Dec 2007 12:42 GMT
You can step through the code in the Visual Studio debugger when you run the
site in Visual Studio in Debug mode. It will load the pages and code files
into the Editor when they are used. This is assuming that there are no DLLs
in use (you didn't mention any), or that the DLLs are debuggable.

Signature

HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

> I'm trying to fix a site that someone has left me and - to understate
> it - it is huge!
[quoted text clipped - 12 lines]
>
> Just to make things worse its Vis Studio 2003, .NET 1.1
JB - 20 Dec 2007 13:59 GMT
I can step through all the way until the code stops - and the page has
completed loading.
but once it has loaded - and i need to interact with the site to get
to the page i want, stepping through stops and it just continues
through all the way. Unless i am missing a setting somewhere?

> You can step through the code in the Visual Studio debugger when you run the
> site in Visual Studio in Debug mode. It will load the pages and code files
[quoted text clipped - 24 lines]
>
> > Just to make things worse its Vis Studio 2003, .NET 1.1
Kevin Spencer - 21 Dec 2007 11:47 GMT
You can put break points in any page that is requested during the debugging
session, and the debugger will stop at those. Presumably, you should be able
to identify that pages that you will be requesting via their URLs.

Signature

HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

>I can step through all the way until the code stops - and the page has
> completed loading.
[quoted text clipped - 33 lines]
>>
>> > Just to make things worse its Vis Studio 2003, .NET 1.1
JB - 21 Dec 2007 13:16 GMT
Well that was my problem.
The page i want is linked off default.aspx, but its not a page as
such, its a dialog box - hance no URL.
And the link isn't really a link - i beleive its some sort of
Javascript menu - and a breakpoint in a js file doesnt seem to work.
I can put in breakpoints, but it is not at all obvious where the code
is handling the menu Click event - I can step through all the way
through the page initialization until i get to the point where it is
sitting waiting for user input, then it seems to turn stepping through
off itself.

> You can put break points in any page that is requested during the debugging
> session, and the debugger will stop at those. Presumably, you should be able
[quoted text clipped - 48 lines]
>
> >> > Just to make things worse its Vis Studio 2003, .NET 1.1
Mark Rae [MVP] - 21 Dec 2007 13:51 GMT
> a breakpoint in a js file doesnt seem to work.

In that case, use the debugger; command e.g.

<script type="text/javascript">
   function myFunction()
   {
       debugger;        // execution will break here
       alert('Hello');
   }
</script>

http://www.google.co.uk/search?sourceid=navclient&aq=t&hl=en-GB&ie=UTF-8&rlz=1T4
GZEZ_en-GBGB252GB252&q=JavaScript+debugger


Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

JB - 21 Dec 2007 15:04 GMT
Ah Cheers thats an excellent idea.
I will take a look at this in the week to come.

> > a breakpoint in a js file doesnt seem to work.
>
[quoted text clipped - 13 lines]
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net
Mark Rae [MVP] - 20 Dec 2007 12:47 GMT
> There is a menu on the main page which, when clicked brings up a
> dialog box which needs filling out. I just can't find the code for
> this section.

Does the dialog box not have any text in it that you could use as your
search criterion in VS.NET...?

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

JB - 20 Dec 2007 13:59 GMT
> > There is a menu on the main page which, when clicked brings up a
> > dialog box which needs filling out. I just can't find the code for
[quoted text clipped - 6 lines]
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

Alas, no. I did a search and only found corresponding text in a .isql
document in a stored procedure.
Searching for the procedure name didnt bring up anything, which i
thought was odd...
Mark Rae [MVP] - 20 Dec 2007 14:50 GMT
>> > There is a menu on the main page which, when clicked brings up a
>> > dialog box which needs filling out. I just can't find the code for
[quoted text clipped - 7 lines]
> Searching for the procedure name didnt bring up anything, which i
> thought was odd...

Hmm - well, the page from which the dialog box is launched must display its
name in the  browser address bar, so I guess that's your starting point...

I've been in your situation before many times, and don't envy you one bit!

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Mohamad Elarabi - 20 Dec 2007 19:45 GMT
You can turn tracing on either in the web config or on that aspx page you're
debugging also turn debug=true.

The problem with stepping through is that you get the top-bottom run process
but you may not go through all events that actually take place.

If you look at the aspx page, the code that's rendering is either on the
page itself, in a master page, or in a control that is used on the page. If
you suspect a certain custom control you can right click on its name and
select "Go to definition" and that might take you to the control's code where
you can put breaks there as well.

Good luck with this. I hate it when that happens.

Signature

Mohamad Elarabi
Lead Developer. MCTS, MCPD.

> > > There is a menu on the main page which, when clicked brings up a
> > > dialog box which needs filling out. I just can't find the code for
[quoted text clipped - 11 lines]
> Searching for the procedure name didnt bring up anything, which i
> thought was odd...

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.