Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: Debugger skips client-side breakpoints in ASP.NET projects


View products that this article applies to.

This article was previously published under Q317094

↑ Back to the top


Symptoms

Visual Studio ASP.NET projects allow you to set breakpoints in either server-side or client-side code. However, when you start to debug, the debugger does not stop at client-side breakpoints in the ASP.NET project.

↑ Back to the top


Resolution

To work around this problem, follow these steps:
  1. Enable debugging in your browser. To do this in Microsoft Internet Explorer 6.0, follow these steps:
    1. On the Tools menu, click Internet Options.
    2. On the Advanced tab, clear the Disable script debugging check box, and then click OK.
  2. Insert a stop or a debugger statement in your client-side code. In Microsoft Visual Basic Scripting Editing (VBScript), use the stop statement. In JScript, use the debugger statement.

    The following code illustrates how to use these statements in the OnLoad event:
    'VBScript
    Sub window_onload
        stop
        'Insert onload code here.
    End Sub
    
    
    //JScript
    function window_onload() {
        debugger;
        //Insert onload code here.
    }
    When your browser reaches the stop or the debugger statement, the browser invokes the debugger (Visual Studio) to enter debug mode. If you have multiple debuggers installed on the computer, the browser prompts you to select a debugger.

    After the browser invokes a debugger, the browser displays the HTML page, which includes the client-side code but not the server-side code. The browser stops in break mode on the stop or the debugger statement.
  3. To set additional breakpoints in the code, click in the gray margin to the left of any line of code.
  4. To set breakpoints that stop only under certain conditions (conditional breakpoints), right-click on the breakpoint entry in the BreakPoints window in Visual Studio .NET, and then click Properties.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


More information

Steps to reproduce the problem

  1. In Visual Studio .NET, create a new ASP.NET project. WebForm1.aspx is created by default.
  2. When you open WebForm1.aspx in Visual Studio .NET, two tabs (Design and HTML) appear at the bottom of the page. Switch to HTML view.
  3. Add the following code to the Body section:
    <script language="vbscript">
        sub btn_onclick
        btn.value = btn.value + 1
        end sub
    </script>
    <INPUT type="button" value="0" id="btn">
  4. Set breakpoints in the client-side code. The btn_onclick procedure is client-side code. To set a breakpoint in this procedure, click in the gray margin to the left of the following code:
    btn.value = btn.value + 1
    After you set the breakpoint, a red dot appears in the gray margin next to that line of code.
  5. In the Solution Explorer window, right-click WebForm1, and then click Set As Start Page.
  6. Save your project.
  7. On the Build menu, click Build Project.
  8. On the Debug menu, click Start (or press the F5 key) to start a debug session.
  9. After the page appears in your browser, click the button. Notice that the client-side code runs, but the debugger does not stop at your breakpoint.

↑ Back to the top


Keywords: kbvs2002sp1sweep, kbbug, kbdebug, kbide, kbpending, kbscript, KB317094

↑ Back to the top

Article Info
Article ID : 317094
Revision : 8
Created on : 8/29/2005
Published on : 8/29/2005
Exists online : False
Views : 606