简体   繁体   中英

How to debug JavaScript script in cshtml ASP.NET core ( by using Chrome browser or in Visual Studio 2019)?

I am using ASP.NET Core and I have html page that is in cshtml format and c# controller in cshtml.cs format. In html(cshtml) page I have a part of code that is and I need to debug it. But when I debug in the Chrome it shows that it is dynamically loaded, so can not see it. How could I make it to show in Chrome or should I debug this js script in Visual Studio? Here is picture

Try looking into this post: How to debug dynamically loaded JavaScript (with jQuery) in the browser's debugger itself?

I had the same issue when debugging dynamically loaded JavaScript, it just did not show anything like here: 调试动态加载的 JavaScript 时没有显示任何内容

And when I added //# sourceURL=whatEvertheNameIS.js before the </script> ends in the html page,

html

it did become visible during debug in the chrome. 在 chrome 中调试。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM