asp.net mvc - breakpoint on javascript in CSHTML? -


i have .cshtml file has javascript tag. within script tag have few lines of javascript. first line of javascript refers property in @viewbag. other javascript lines plain script without mvc related references.

observation: can place breakpoints (visual studio 2015) on each of these javascript lines. however, breakpoints has white dot in center of breakpoint symbol (red circle) except line @viewbag reference (this particular line not have white dot in center).

it seems breakpoint without white dot hit during run-time.

question: can explain going on here? white dot mean? why plain red breakpoint line line hitting breakpoint?

the visual studio debugger expecting debug actual server-side code within .cshtml file opposed client-side javascript within it.

iirc, visual studio allow debug javascript code expected in internet explorer (and possibly edge), other browsers want use either third-party tool or developer tools (f12) within browser.

an easy approach take advantage of javascript's debugger keyword, can place in code , run developer tools open (just press f12 , refresh page). hit breakpoint , browser allow step through code might expect :

function dowork(){     // ensure line hit developer tools open in      // browser     debugger;     // work here } 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -