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. how to access hiddenfield in usercontrol which is there in master page.

how to access hiddenfield in usercontrol which is there in master page.

Scheduled Pinned Locked Moved ASP.NET
javascripthelptutorial
6 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.
  • B Offline
    B Offline
    bhavna4321
    wrote on last edited by
    #1

    in javascript it is document.getElementById(<%=h1.ClientID%>).value; it is giving me error. Can anyone please let me know how to access this .

    V B P 3 Replies Last reply
    0
    • B bhavna4321

      in javascript it is document.getElementById(<%=h1.ClientID%>).value; it is giving me error. Can anyone please let me know how to access this .

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      try this http://forums.asp.net/p/1017379/1370211.aspx[^]

      Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

      1 Reply Last reply
      0
      • B bhavna4321

        in javascript it is document.getElementById(<%=h1.ClientID%>).value; it is giving me error. Can anyone please let me know how to access this .

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

        Dont put the scriplet in document.getElementById.Use global variable to get the clientid of hidden variable as

        var hiddenClientID = "<%=h1.ClientID%>";.

        Put the above script in masterpage itself. Now access the hidden field using hiddenClientID in usercontrol as

        document.getElementById(hiddenClientID).value

        Let me know if still face problem

        Cheers!! Brij

        1 Reply Last reply
        0
        • B bhavna4321

          in javascript it is document.getElementById(<%=h1.ClientID%>).value; it is giving me error. Can anyone please let me know how to access this .

          P Offline
          P Offline
          Pranay Rana
          wrote on last edited by
          #4

          try below code document.getElementById(<%=Page.Master.FindControl("h1").ClientID%>).value;

          B 1 Reply Last reply
          0
          • P Pranay Rana

            try below code document.getElementById(<%=Page.Master.FindControl("h1").ClientID%>).value;

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

            document.getElementById("<%=Page.Master.FindControl("h1").ClientID%>").value="dirty"; not working on usercontrol

            B 1 Reply Last reply
            0
            • B bhavna4321

              document.getElementById("<%=Page.Master.FindControl("h1").ClientID%>").value="dirty"; not working on usercontrol

              B Offline
              B Offline
              Brij
              wrote on last edited by
              #6

              did you try what I suggested?

              Cheers!! Brij

              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