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. Accessing Child Control from a user control bY Java Script

Accessing Child Control from a user control bY Java Script

Scheduled Pinned Locked Moved ASP.NET
javajavascripttools
4 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.
  • M Offline
    M Offline
    meetbinu2003
    wrote on last edited by
    #1

    hi, I have a user control with one textbox(ie a javascript calender). I want to access the value of text box by javascript User control name: Cal1 textbox ID=txt_Date By Binu Varghese

    P 1 Reply Last reply
    0
    • M meetbinu2003

      hi, I have a user control with one textbox(ie a javascript calender). I want to access the value of text box by javascript User control name: Cal1 textbox ID=txt_Date By Binu Varghese

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      You will need to output the client id of the control (i.e. txt_date.clientID) to the page as a javascript variable. The client id depends on the nesting of the user control in other server controls on the page.

      M 1 Reply Last reply
      0
      • P Paddy Boyd

        You will need to output the client id of the control (i.e. txt_date.clientID) to the page as a javascript variable. The client id depends on the nesting of the user control in other server controls on the page.

        M Offline
        M Offline
        meetbinu2003
        wrote on last edited by
        #3

        i didn't get you, how to output the clientID of the text box. Can u help me to solve the problem.?

        E 1 Reply Last reply
        0
        • M meetbinu2003

          i didn't get you, how to output the clientID of the text box. Can u help me to solve the problem.?

          E Offline
          E Offline
          eggsovereasy
          wrote on last edited by
          #4

          Either put it in the mark up as an attribute on the text box, or assign it in the code behind : tbYourTextBox.ClientID.

          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