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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. User Control Problem

User Control Problem

Scheduled Pinned Locked Moved ASP.NET
hardwarehelptutorialquestion
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.
  • C Offline
    C Offline
    Captain Trips
    wrote on last edited by
    #1

    I've created a pop up calendar user control, when you click inside the text box the calendar appears, when u select a date it disappears etc. This all works fine. The part I'm having trouble with is that when a user clicks off the calendar while it is visible i want it to disappear again. I'm not really sure how to do this? Is it possible to access the actual calendar control in the user control from the page that the user control is embedded. I played around with getElementByName and getElementById but didn't have any luck. thanks Steve

    J J C 3 Replies Last reply
    0
    • C Captain Trips

      I've created a pop up calendar user control, when you click inside the text box the calendar appears, when u select a date it disappears etc. This all works fine. The part I'm having trouble with is that when a user clicks off the calendar while it is visible i want it to disappear again. I'm not really sure how to do this? Is it possible to access the actual calendar control in the user control from the page that the user control is embedded. I played around with getElementByName and getElementById but didn't have any luck. thanks Steve

      J Offline
      J Offline
      just3ala2
      wrote on last edited by
      #2

      I guess u should use the onclick javascript event on the main page body And u can find the control in the userscontrol by using the document.getElementById function but u need to check the if in the HTML because when a server controlresides in a user control the id isn't the same it will be the id + "_" + user control name Hope this would help

      Best Regards 3ala2 :)

      1 Reply Last reply
      0
      • C Captain Trips

        I've created a pop up calendar user control, when you click inside the text box the calendar appears, when u select a date it disappears etc. This all works fine. The part I'm having trouble with is that when a user clicks off the calendar while it is visible i want it to disappear again. I'm not really sure how to do this? Is it possible to access the actual calendar control in the user control from the page that the user control is embedded. I played around with getElementByName and getElementById but didn't have any luck. thanks Steve

        J Offline
        J Offline
        jc net
        wrote on last edited by
        #3

        You could try this:

        That is if you by popup mean that it pops up in a new window.

        1 Reply Last reply
        0
        • C Captain Trips

          I've created a pop up calendar user control, when you click inside the text box the calendar appears, when u select a date it disappears etc. This all works fine. The part I'm having trouble with is that when a user clicks off the calendar while it is visible i want it to disappear again. I'm not really sure how to do this? Is it possible to access the actual calendar control in the user control from the page that the user control is embedded. I played around with getElementByName and getElementById but didn't have any luck. thanks Steve

          C Offline
          C Offline
          Captain Trips
          wrote on last edited by
          #4

          I'm at the stage now where I have the calendar disappearing when the user clicks elsewhere on the form. My problem now is that when you click on the text box to make the calendar appear the form click event also fires. Which immediately makes the calendar disappear again? Is there any way to exclude the text box from getting caught by the click event of the form? thanks Steve

          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