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. JavaScript
  4. Trying to use age.ClientScript.RegisterHiddenField - need help

Trying to use age.ClientScript.RegisterHiddenField - need help

Scheduled Pinned Locked Moved JavaScript
helpjavajavascriptwinformstools
1 Posts 1 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.
  • U Offline
    U Offline
    User 7763270
    wrote on last edited by
    #1

    Hi, I have a myPage.aspx page and 2 user controls, ucA and ucB. ucA (parent control) is being used in ucB (child control inherits ucA). Finallly ucB is registered in myPage.aspx. I have two dropdowns in ucB. Now, I am trying to put the selected values of these dropwdowns in a hidden variables using the below code and I am putting this in myPage.aspx page_load code Page.ClientScript.RegisterHiddenField("LabValue", labname selectedvalue using FindControl) Page.ClientScript.RegisterHiddenField("ClientValue", ClientName SelectdValue using FindControl)) The above code runs fine and no errors. Now in the exeternal .js file I am accessing this values as var lv = document.getElementById("LabValue").value; var cv = document.getElementById("ClientValue").value; All look fine. But the issue is no matter what values I put in the LabValue and ClientValue hidden fields I always get the values as 0 for lv and cv (java script variables). Say for instance if LabValue is 10002 when I try to access it via javasacript using document.getElementById("LabValue").value; I always get 0 instead of 10002. It is the same case with the other hidden field too. When I looked at the myPage.aspx viewsource I always see <input type="hidden" name="LabValue" id="LabValue" value="0" /> Am I missing some thing here? Thanks in advance, L

    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