1

I'm missing the ability to do 'document.getElementbyId('foo')' and evaluate it or get a list of all the methods etc. when setting a break point in the code behind.

Is this possible to get it from the watch window? (when I type 'document' in the watch window it says:"The name 'document' does not exist in the current context")

BornToCode
  • 9,495
  • 9
  • 66
  • 83

2 Answers2

1

If you want to just watch javasript, I suggest FireBug plugin in firefox, or Google Chrome Developer Tool bug(F12), or IE developer tool bar(F12)

Simon Wang
  • 2,843
  • 1
  • 16
  • 32
  • (I find firebug and friends lacking comparing to quickwatch in readability and functionality for example evaluating a div.innerhtml after I reach a break point in the c# code). Anyway thank you for helping me focus my question. – BornToCode Feb 29 '12 at 09:44
0

After reading Simon Wang's comment, an idea came into my mind:

In the .aspx file I write:

<asp:Literal Text="" ID="activate_debugger" runat="server"></asp:Literal>

In the code-behind, instead of setting a break point, before the line I would usually create a breakpoing I write:

activate_debugger.Text = "<script type='text/javascript'>debugger;</script>";

now I can open the watch window and write document.getElementById('foo');

BornToCode
  • 9,495
  • 9
  • 66
  • 83