Issues with debugging an asp.net project

K

Ken Dourado

Hi,

I have an issue debugging my asp.net project. On a particular aspx
page, in the code behind cs file, my breakpoints are not being hit. The
breakpoint is in the Page_Load() method and is a proper line of code
where a variable is assigned a value (not a blank line, curly brace or
anything else).

Breakpoints on other .cs code behind files pages in my project are hit
without any problems, the issue is with this single page.

I have set VS.NET up in debug mode (not release), the web.config file
has debug set to true and my project debugging configuration properties
have 'Enable ASP.NET Debugging' set to true. I have also added
debug=true to the page directive in the aspx file.

I am not getting anywhere.

I'd appreciate any help or advice.

Thank you,

Ken Dourado.
 
A

AW

Ok, the breakpoints aren't reached, but is the code executed anyway? I mean,
is the code in the Page_Load executed? To be sure about that, you can place
a Response.Write in it.

If the breakpoint isn't reached AND the code isn't executed, it is most
likely that your Page_Load is not called. This may be due to a bug in Visual
Studio.net, where it removes the event handlers:
-if using VB.Net, check that the "Handles Page.Load" wasn't removed at the
end of the Page_Load declaration
-if using C#, check that the Page.Load += new EventHandler(Page_Load) is
still there in the hidden code part of the CodeBehind file.
 
K

Ken Dourado

Arnaud,

Thanks for that - the change worked. I don't think I'll ever forget to
check that now if it ever happens again.

Regards,

Ken.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top