Javascript debugger for ASP.net web forms project noy working

Manoj Gokhale 40 Reputation points
2023-06-04T10:44:51.97+00:00

Hello

I am working in Visual studio 2019 web forms VB.net ASP.net and I am using javascript. I have put the breakpoints but the execution is erratic. The breakpoints at the start of the javascript procedure are not working. the alert messages are displayed.

When I hover the breakpoint in javascript code. It tells me that "the breakpoint will not be hit" why?

The javascript breakpoint are not displayed properly and I think I have not set an appropriate setting / option somewhere.

Please help me

Manoj gokhale

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,221 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 53,501 Reputation points
    2023-06-04T17:06:28.96+00:00

    Visual studio users webkit’s remote debugging feature. After the page loaded, vs will attach the debugger. Often the attach will happen after the startup code has run.

    as suggested to debug startup code you use the browser debugger. Load the page. Set the breakpoint in the browsers debugger. Then reload the page.

    0 comments No comments

  2. Lan Huang-MSFT 24,461 Reputation points Microsoft Vendor
    2023-06-05T08:27:36.0433333+00:00

    Hi @Manoj Gokhale,

    Are you using internal javascript or external javascript?

    For ASP.NET and ASP.NET Core, debugging embedded scripts in .CSHTML files is not supported. JavaScript code must be in separate files to enable debugging.

    Debug client-side script

    If you are using external javascript, you can refer to the following post:

    Javascript breakpoint not work in Visual Studio 2019 asp.net application

    If you are using internal javascript, you can open the developer tools (press F12) before the script executes.

    User's image

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.