alternative to javascript
-
I posted this in another group but thought maybe this is the better one to get a more thorough response. I am using visual studio .net to write some apps. In the past when I wrote applications I used a lot of java script (I have a lot of scripts). I have been including these scripts in VS. wWile they work I find it hard to debug them. For example I can't set break points or watch variables. Is there an alternative? Can I rewiret my JS in C# and use them in VS. Most of what I am doing is clients side using an active X plug in. Thanks
-
I posted this in another group but thought maybe this is the better one to get a more thorough response. I am using visual studio .net to write some apps. In the past when I wrote applications I used a lot of java script (I have a lot of scripts). I have been including these scripts in VS. wWile they work I find it hard to debug them. For example I can't set break points or watch variables. Is there an alternative? Can I rewiret my JS in C# and use them in VS. Most of what I am doing is clients side using an active X plug in. Thanks
Hi there, Basically, you use javascript code to do things on the client machine, and server code (c# or VB.NET ...) executes on the server. Depending on what you do, then you can convert your client side script to server side code accordingly. To access properties/methods of an ActiveX plugin such as Windows media player or Real player ... you'd normally use client side scripts. If you are not familiar with debugging client side script, you can take a look at some documents which may help: Debugging Client-Side Scripts[^] How To Debug Client-Side Script in Visual С# .NET[^]
-
Hi there, Basically, you use javascript code to do things on the client machine, and server code (c# or VB.NET ...) executes on the server. Depending on what you do, then you can convert your client side script to server side code accordingly. To access properties/methods of an ActiveX plugin such as Windows media player or Real player ... you'd normally use client side scripts. If you are not familiar with debugging client side script, you can take a look at some documents which may help: Debugging Client-Side Scripts[^] How To Debug Client-Side Script in Visual С# .NET[^]
I made changes as directed. When debugging I still do not stop at the break point. When I mouse over the break point I get he message "The breakpoint will not be hit. No symbols currnelty loaded for this document" What do you suggest? I did not enter and run the cookie code yet? should I? Brian
-
I made changes as directed. When debugging I still do not stop at the break point. When I mouse over the break point I get he message "The breakpoint will not be hit. No symbols currnelty loaded for this document" What do you suggest? I did not enter and run the cookie code yet? should I? Brian
+ You first need to make sure that you don't select the option
"Disable script debugging"
in the Internet Options of the Internet Explorer. + Where do you put your client side script? If you put it in the web page aspx, you should not set the breakpoint in the client side script until the debugger is started. + Do you put thedebugger
keyword at the very first line of your script? + How do you start the debugger? using the menu Debug/Start (F5 key) or attaching the process? + Can you try to debug a very simple application containing some client side script like one in the provided document with the debugger? Once it runs, you can go back to your project. + Actually, the cookie code does not make sense here as you want to debug your client side script with the debugger. -
+ You first need to make sure that you don't select the option
"Disable script debugging"
in the Internet Options of the Internet Explorer. + Where do you put your client side script? If you put it in the web page aspx, you should not set the breakpoint in the client side script until the debugger is started. + Do you put thedebugger
keyword at the very first line of your script? + How do you start the debugger? using the menu Debug/Start (F5 key) or attaching the process? + Can you try to debug a very simple application containing some client side script like one in the provided document with the debugger? Once it runs, you can go back to your project. + Actually, the cookie code does not make sense here as you want to debug your client side script with the debugger.The script is in a separate file that I added to the project. How do I add the name debugger? Do I simply type this on the first line of code in the JS file? I start debugger with f5 Thanks for the help. One more thing. The program I am writing makes use of an active X client that has a lot of objects and methods. Can I get access to these while in VS? Brian
-
The script is in a separate file that I added to the project. How do I add the name debugger? Do I simply type this on the first line of code in the JS file? I start debugger with f5 Thanks for the help. One more thing. The program I am writing makes use of an active X client that has a lot of objects and methods. Can I get access to these while in VS? Brian
Brian, Yes, you simply type the keyword
debugger
on the first line of code in the js file, for example the function btnDivide_Clicked is put in the simple.js file, at runtime you want to debug this function:function btnDivide_Clicked()
{
debugger
...
}brian55 wrote: One more thing. The program I am writing makes use of an active X client that has a lot of objects and methods. Can I get access to these while in VS? Yes, you can. Basically, ActiveX control is an unmanaged code component, so you need to create a runtime-callable wrapper for it to make use of it in your .net application, and there are two ways to do that: you either use the tlbimp.exe tool or simply add reference to it in VS, then VS automatically generate the wrapper for you. At design time, you can use Object Browser to view all methods/properties of the ActiveX component. There are a couple of documents which may give you some good info: HOW TO: Use ActiveX Components in Visual Studio .NET with Visual Basic .NET[^] HOW TO: Host ActiveX Controls in a Web Form[^] Interoperating with Unmanaged Code[^]