Sccript debugging in Visual Studio

  • Thread starter Thread starter gemel
  • Start date Start date
G

gemel

I am trying to debug the client script of a CustomValidator, but VS
seems to ignore it completely. This is waht I do:

Enable script debugging in Internet Explorer
Launch the page from Internet Explorer
In VS set a breakpoint in the script
Attach the IExplore debug process
Operate on the page to cause the script to run.

But all the hppens is that both the client side script and server side
script run, but no breakpont is executed

Am I missing something?

The script is javascript.


John L
 
setting a breakpoint in the script will not work. after attaching to IE,
open running documents, and set the breakpoint there.

-- bruce (sqlwork.com)

| I am trying to debug the client script of a CustomValidator, but VS
| seems to ignore it completely. This is waht I do:
|
| Enable script debugging in Internet Explorer
| Launch the page from Internet Explorer
| In VS set a breakpoint in the script
| Attach the IExplore debug process
| Operate on the page to cause the script to run.
|
| But all the hppens is that both the client side script and server side
| script run, but no breakpont is executed
|
| Am I missing something?
|
| The script is javascript.
|
|
| John L
 
The "easy" way is the put the line debugger; into your javascript file, ie
will break and prompt to open a debub session.

Otherwise, you will have to open the webpage, then attach the Studio
debugger to the iexplore.exe process. Then step through the running
documents to find the script you are looking for and set a break point
there.

But if you have complete access to the script file, I would just use the
"debugger;" line.

bill
 
Bill,
Thans for the advice. However I'm not really sure you mean by the
'debugger line'

Regards

John L
 
in your javascript

function ValidateValue( control )
{
//the debugger line is as though there is a break point defined.
//it will prompt which debugger you want to use.
debugger;

if ( control.value.length != 0 ) return true;

return false;
}

You probably will have to have the script debugging turned on in IE.

Tools -> Internet Options ->Advanced(tab)

Make sure "Disable script debugging" is unchecked.

bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top