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. How to refer the controls of a webuser control??

How to refer the controls of a webuser control??

Scheduled Pinned Locked Moved ASP.NET
designsysadminhelptutorialquestion
9 Posts 4 Posters 1 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.
  • K Offline
    K Offline
    kvPriya
    wrote on last edited by
    #1

    Hai, I have a webuser control enriched with some web server controls.In a web form,I have to refer the properties of the controls of webuser control.While I am referring those properties, an error is raising as '.protected dim with events as system.web.ui.webcontrols.textbox' is not accessible in this context because it is 'protected'. Where can I declare the control as public in a web application? and how we can do that? Any suggestions......please welcome... -Priya

    S _ 2 Replies Last reply
    0
    • K kvPriya

      Hai, I have a webuser control enriched with some web server controls.In a web form,I have to refer the properties of the controls of webuser control.While I am referring those properties, an error is raising as '.protected dim with events as system.web.ui.webcontrols.textbox' is not accessible in this context because it is 'protected'. Where can I declare the control as public in a web application? and how we can do that? Any suggestions......please welcome... -Priya

      S Offline
      S Offline
      Sivaprasad C
      wrote on last edited by
      #2

      U can Refer the controls in the usercontrol by ((controltype)Page.FindControl("controlId") ((Button)Page.FindControl("btnxxx"))

      Regards, Sivaprasad

      K 1 Reply Last reply
      0
      • K kvPriya

        Hai, I have a webuser control enriched with some web server controls.In a web form,I have to refer the properties of the controls of webuser control.While I am referring those properties, an error is raising as '.protected dim with events as system.web.ui.webcontrols.textbox' is not accessible in this context because it is 'protected'. Where can I declare the control as public in a web application? and how we can do that? Any suggestions......please welcome... -Priya

        _ Offline
        _ Offline
        _AK_
        wrote on last edited by
        #3

        If you want to use the controls of the usercontrol(ascx file), then you have to make them public.

        Best Regards, Apurva Kaushal

        K 1 Reply Last reply
        0
        • _ _AK_

          If you want to use the controls of the usercontrol(ascx file), then you have to make them public.

          Best Regards, Apurva Kaushal

          K Offline
          K Offline
          kvPriya
          wrote on last edited by
          #4

          Thanq, can u please tell where we can make the controls as public in asp.net 2.0 so that we can use them anywhere in the project??? -Priya

          _ 1 Reply Last reply
          0
          • K kvPriya

            Thanq, can u please tell where we can make the controls as public in asp.net 2.0 so that we can use them anywhere in the project??? -Priya

            _ Offline
            _ Offline
            _AK_
            wrote on last edited by
            #5

            I haven't worked on 2.0 but you can make them public where they have been declared.

            Best Regards, Apurva Kaushal

            K 1 Reply Last reply
            0
            • S Sivaprasad C

              U can Refer the controls in the usercontrol by ((controltype)Page.FindControl("controlId") ((Button)Page.FindControl("btnxxx"))

              Regards, Sivaprasad

              K Offline
              K Offline
              kvPriya
              wrote on last edited by
              #6

              Thanq, but I need to refer the controls of web user control in some other .aspx page. Using Page.FindControl() , we can refer the control in the same page.But, how can we refer it at some other web form? -Priya

              1 Reply Last reply
              0
              • _ _AK_

                I haven't worked on 2.0 but you can make them public where they have been declared.

                Best Regards, Apurva Kaushal

                K Offline
                K Offline
                kvPriya
                wrote on last edited by
                #7

                In 1.1, we can view the designer generated code for a web form. But, for 2.0, I didn't find anywhere such automatic generated code for the control declarations.I am new to the 2.0. Anyway, thanks Kaushal. -Priya

                _ E 2 Replies Last reply
                0
                • K kvPriya

                  In 1.1, we can view the designer generated code for a web form. But, for 2.0, I didn't find anywhere such automatic generated code for the control declarations.I am new to the 2.0. Anyway, thanks Kaushal. -Priya

                  _ Offline
                  _ Offline
                  _AK_
                  wrote on last edited by
                  #8

                  probably this article may give you some assistance: http://msdn.microsoft.com/msdnmag/issues/06/01/ExtremeASPNET/[^]

                  Best Regards, Apurva Kaushal

                  1 Reply Last reply
                  0
                  • K kvPriya

                    In 1.1, we can view the designer generated code for a web form. But, for 2.0, I didn't find anywhere such automatic generated code for the control declarations.I am new to the 2.0. Anyway, thanks Kaushal. -Priya

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

                    Make a public method in the user control that will modifiy the controls you wish modified.

                    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