Microsoft KB Archive/317094

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

Article ID: 317094

Article Last Modified on 8/29/2005

-

APPLIES TO


 * Microsoft ASP.NET 1.0
 * Microsoft ASP.NET 1.1
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition

-



This article was previously published under Q317094





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.



RESOLUTION
To work around this problem, follow these steps:  Enable debugging in your browser. To do this in Microsoft Internet Explorer 6.0, follow these steps:  On the Tools menu, click Internet Options. On the Advanced tab, clear the Disable script debugging check box, and then click OK.   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.  To set additional breakpoints in the code, click in the gray margin to the left of any line of code.</li> 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.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.

<div class="moreinformation_section">

Steps to reproduce the problem
 In Visual Studio .NET, create a new ASP.NET project. WebForm1.aspx is created by default.</li> 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.</li>  Add the following code to the Body section: <script language=&quot;vbscript&quot;> sub btn_onclick btn.value = btn.value + 1 end sub <INPUT type=&quot;button&quot; value=&quot;0&quot; id=&quot;btn&quot;> </li>  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. </li> In the Solution Explorer window, right-click WebForm1, and then click Set As Start Page.</li> Save your project.</li> On the Build menu, click Build Project.</li> On the Debug menu, click Start (or press the F5 key) to start a debug session.</li> 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.</li></ol>

Additional query words: break point stop debugger command

Keywords: kbbug kbscript kbide kbdebug kbpending kbvs2002sp1sweep KB317094

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.