Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. alternative to javascript

alternative to javascript

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptvisual-studiojavadebugging
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    brian55
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • B brian55

      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

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      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[^]

      B 1 Reply Last reply
      0
      • M minhpc_bk

        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[^]

        B Offline
        B Offline
        brian55
        wrote on last edited by
        #3

        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

        M 1 Reply Last reply
        0
        • B brian55

          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

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          + 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 the debugger 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.

          B 1 Reply Last reply
          0
          • M minhpc_bk

            + 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 the debugger 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.

            B Offline
            B Offline
            brian55
            wrote on last edited by
            #5

            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

            M 1 Reply Last reply
            0
            • B brian55

              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

              M Offline
              M Offline
              minhpc_bk
              wrote on last edited by
              #6

              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[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups