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. General Programming
  3. C#
  4. display javascript value on a label

display javascript value on a label

Scheduled Pinned Locked Moved C#
javascripthtml
4 Posts 4 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.
  • P Offline
    P Offline
    P_Elza
    wrote on last edited by
    #1

    hi all i'm doing a mantanence project. In that some code i write in javascript in html page. Is it possible to display a variablr value on label when we run the application. If so, then how can it be done

    A C V 3 Replies Last reply
    0
    • P P_Elza

      hi all i'm doing a mantanence project. In that some code i write in javascript in html page. Is it possible to display a variablr value on label when we run the application. If so, then how can it be done

      A Offline
      A Offline
      Andrei Ungureanu
      wrote on last edited by
      #2

      You give the label an ID. And in javascript use the document.GetElementByID(id) and set the value attribute. Hope it helps.

      There are 10 kinds of people: those who understand binary and those who don't

      1 Reply Last reply
      0
      • P P_Elza

        hi all i'm doing a mantanence project. In that some code i write in javascript in html page. Is it possible to display a variablr value on label when we run the application. If so, then how can it be done

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        if by label you mean an ASP.NET control, the wrinkle is that the ClientID is not the ID you set, so you need to find the client Id for getElementByName

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        1 Reply Last reply
        0
        • P P_Elza

          hi all i'm doing a mantanence project. In that some code i write in javascript in html page. Is it possible to display a variablr value on label when we run the application. If so, then how can it be done

          V Offline
          V Offline
          Vasudevan Deepak Kumar
          wrote on last edited by
          #4

          P_Elza wrote:

          label

          asp:Label is rendered as a SPAN. You can access the span in JavaScript using document.getElementById("spanid");

          Vasudevan Deepak Kumar Personal Homepage Tech Gossips

          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