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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How can I access the Server controls in Javascript function

How can I access the Server controls in Javascript function

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptcomsysadminquestion
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.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Dear all Can I access any Server control in Javascript function in .Net. And I want to update the Server controls values from within the Javascript function.

    S/W Engineer Akebono Soft Technologies aleem_abdul@akebonosoft.com.

    A 1 Reply Last reply
    0
    • I indian143

      Dear all Can I access any Server control in Javascript function in .Net. And I want to update the Server controls values from within the Javascript function.

      S/W Engineer Akebono Soft Technologies aleem_abdul@akebonosoft.com.

      A Offline
      A Offline
      alav
      wrote on last edited by
      #2

      Hi, All server control will be treated as html control after they render on a page, this is the basic idea to access the server control in javascript. You can use the DOM(document object model), to access and modify the server control values. For eg. A server control(Textbox) named as "username". Then to modify the value, document.getElementById('username').value="someuser"; to access the value, alert(document.getElementById('username').value); You can use it in any javascript function.

      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