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. Access Usercontrols server-side objects from code behind in aspx page

Access Usercontrols server-side objects from code behind in aspx page

Scheduled Pinned Locked Moved ASP.NET
sysadmintutorial
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.
  • R Offline
    R Offline
    Ramya SM
    wrote on last edited by
    #1

    How to access usercontrol's Server side objects from the aspx codebehind that has teh usercontrol:rolleyes: Ramya

    S 1 Reply Last reply
    0
    • R Ramya SM

      How to access usercontrol's Server side objects from the aspx codebehind that has teh usercontrol:rolleyes: Ramya

      S Offline
      S Offline
      ssoffline
      wrote on last edited by
      #2

      i didn't understand your question, server side of every server control is accesible from codebehind sameer sood :-O

      R 1 Reply Last reply
      0
      • S ssoffline

        i didn't understand your question, server side of every server control is accesible from codebehind sameer sood :-O

        R Offline
        R Offline
        Ramya SM
        wrote on last edited by
        #3

        I am having a usercontrol say address.ascx with a TextBox named txtStreet Using the address.ascx Usercontrol in Register.aspx page Now my question is how to access the object "txtStreet" in Register.aspx Codebehind file I think my question is clear now. Ramya -- modified at 0:50 Thursday 11th May, 2006

        S 1 Reply Last reply
        0
        • R Ramya SM

          I am having a usercontrol say address.ascx with a TextBox named txtStreet Using the address.ascx Usercontrol in Register.aspx page Now my question is how to access the object "txtStreet" in Register.aspx Codebehind file I think my question is clear now. Ramya -- modified at 0:50 Thursday 11th May, 2006

          S Offline
          S Offline
          ssoffline
          wrote on last edited by
          #4

          u can create properties for ur controls and eccess text property of that control, i mean that the place where u hv designed control control.ascx there make a public property ex public string Addresstext { get { return control.text; } set { control.text = value; } } or if u wan't the whole control than you have to make attributes public which is not safe there's another solution use System.Web.UI.Control.FindControl(string controlname) USe Msdn to knw about it it finds a control in a control nd returns it scanning by name i hope ur querry has been answered sameer sood :-O

          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