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. could not access hiddenfield

could not access hiddenfield

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
5 Posts 3 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
    bhavna4321
    wrote on last edited by
    #1

    i have a control in javascript on click of a button i am function menuclicked() { if (myname == 'aruna') { document.getElementById("<%=h1.ClientID%>").value="hidden"; alert(document.getElementById("<%=h1.ClientID%>").value); } } on code file i am accessing the hidden field as if (!IsPostBack) { str =h1.Value ; } but i am getting the value as null. Can anyone please help me with this.

    D 1 Reply Last reply
    0
    • B bhavna4321

      i have a control in javascript on click of a button i am function menuclicked() { if (myname == 'aruna') { document.getElementById("<%=h1.ClientID%>").value="hidden"; alert(document.getElementById("<%=h1.ClientID%>").value); } } on code file i am accessing the hidden field as if (!IsPostBack) { str =h1.Value ; } but i am getting the value as null. Can anyone please help me with this.

      D Offline
      D Offline
      Dinesh Mani
      wrote on last edited by
      #2

      Are you getting the text "hidden" in the javascript alert?

      B 1 Reply Last reply
      0
      • D Dinesh Mani

        Are you getting the text "hidden" in the javascript alert?

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

        yes but could not get in code file.

        D 1 Reply Last reply
        0
        • B bhavna4321

          yes but could not get in code file.

          D Offline
          D Offline
          Dinesh Mani
          wrote on last edited by
          #4

          Disclaimer - I have never used asp:HiddenField, I prefer the HTML input field. But I'm assuming HiddenField and input type hidden work the same way. Is there any other post back happening between the javascript and the server code execution? I mean are you posting the form to the server from the javascript or are you doing it on different events?

          S 1 Reply Last reply
          0
          • D Dinesh Mani

            Disclaimer - I have never used asp:HiddenField, I prefer the HTML input field. But I'm assuming HiddenField and input type hidden work the same way. Is there any other post back happening between the javascript and the server code execution? I mean are you posting the form to the server from the javascript or are you doing it on different events?

            S Offline
            S Offline
            sekannak
            wrote on last edited by
            #5

            Hi, It Has to work...check it out ...settings of browser stuffs and all.. I tried your same problem i got the value from server side in both IE and firefox.... regards, kannak...........

            kannak

            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