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. Web user control

Web user control

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

    How to hide or show a web user control on a form when a button on the form is clicked. aasstt

    W I M 3 Replies Last reply
    0
    • A aasstt

      How to hide or show a web user control on a form when a button on the form is clicked. aasstt

      W Offline
      W Offline
      Wu Country
      wrote on last edited by
      #2

      First of all, you should find the user control, and then hide the control. Control m_userCtrl = this.Page.FindControl("UserControlID"); if(m_userCtrl!=null){ m_userCtrl.Visible = false; }

      1 Reply Last reply
      0
      • A aasstt

        How to hide or show a web user control on a form when a button on the form is clicked. aasstt

        I Offline
        I Offline
        Ista
        wrote on last edited by
        #3

        No need to use find if your know the name, and since you created then you do. just set its visible property to false Only use find if its a large container I'm not an expert yet, but I play one at work. Yeah and here too.

        1 Reply Last reply
        0
        • A aasstt

          How to hide or show a web user control on a form when a button on the form is clicked. aasstt

          M Offline
          M Offline
          munklefish
          wrote on last edited by
          #4

          I have a similar question. I have a log-in field placed within a user control. This user control is used to display this area of the page content in a similar fashion to in classic asp. How do i then disable these fields within the control? Obviously i would use something like TextBox1.Enabled=false; from within the user control. But i cant do this as i need to disable it on the page the control is called from. Help appreciated. Thanks!!1 -- modified at 11:57 Wednesday 28th December, 2005 ive even tried: userControl.TextBoxId.Enabled = false; but this gives the error of the control being unaccessable due to its protection level. But i cant see how to change this protection level.

          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