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. Accessing Java Script from Code behind

Accessing Java Script from Code behind

Scheduled Pinned Locked Moved ASP.NET
questionjavahtmltools
2 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.
  • F Offline
    F Offline
    fume
    wrote on last edited by
    #1

    how can i use/access my java script function in HTML from ASP's code behind?

    S 1 Reply Last reply
    0
    • F fume

      how can i use/access my java script function in HTML from ASP's code behind?

      S Offline
      S Offline
      sivilian
      wrote on last edited by
      #2

      Well you can't really access it as it does not run at the same time. Your code-behind runs server-side and your javascript runs client-side. You could use the RegisterScriptBlocks to add javascript to your HTML, or the Control.Attributes.Add(key, script) function to add javascript event handling to your controls though. If you need to access the result of a javascript function you must take other means, such as putting the result in a hidden text box, and reading it server side. hope this helps, sivilian

      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