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. to get list of controls from content place holder

to get list of controls from content place holder

Scheduled Pinned Locked Moved ASP.NET
4 Posts 2 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.
  • S Offline
    S Offline
    SunithaNallana
    wrote on last edited by
    #1

    :)i need to retrieve all the controls placed in the content place holder in content page ,so that i can get all the textboxes from them to clear their text when i click reset button Suni

    J 1 Reply Last reply
    0
    • S SunithaNallana

      :)i need to retrieve all the controls placed in the content place holder in content page ,so that i can get all the textboxes from them to clear their text when i click reset button Suni

      J Offline
      J Offline
      John ph
      wrote on last edited by
      #2

      You can Navigate through the ContentPlaceHolder Control's and Check the control is of Type TextBox. You can write something like this...

      For Each child As Control In c.Controls         
          If TypeOf child Is TextBox Then               
               CType(child , TextBox).Text = ""
          End If    
      Next
      

      Regards
       - J O H N -


      S 1 Reply Last reply
      0
      • J John ph

        You can Navigate through the ContentPlaceHolder Control's and Check the control is of Type TextBox. You can write something like this...

        For Each child As Control In c.Controls         
            If TypeOf child Is TextBox Then               
                 CType(child , TextBox).Text = ""
            End If    
        Next
        

        Regards
         - J O H N -


        S Offline
        S Offline
        SunithaNallana
        wrote on last edited by
        #3

        :)JohnPrabhu ji! i have tried your code but it's not working. i got it solved this way.. .i put an empty panel .using findcontrol()collected each wanted control and performed desired task on that control. thank you for helping me. Best Wishes. SunithaNallana

        J 1 Reply Last reply
        0
        • S SunithaNallana

          :)JohnPrabhu ji! i have tried your code but it's not working. i got it solved this way.. .i put an empty panel .using findcontrol()collected each wanted control and performed desired task on that control. thank you for helping me. Best Wishes. SunithaNallana

          J Offline
          J Offline
          John ph
          wrote on last edited by
          #4

          I guess .NET Framework is Globalized and It works the same in all the .NET installed PC's all over the world. For some Unknown reason the same code works fine in my System.

          Regards
           - J O H N -


          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