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. UserControl life cycle

UserControl life cycle

Scheduled Pinned Locked Moved ASP.NET
designquestion
3 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.
  • U Offline
    U Offline
    User 1804931
    wrote on last edited by
    #1

    Can anybody please tell me what is the Life Cycle of the UserControls. Because I exposed some propterties(Set properties) in my user control, I want to set the properties of the usercontrol from my WebFrom at design time and the values are not assigning.I am doing this by in pageLoad event of WebForm page. Please tell me where I find the life cycle of the usercontrols. Regard, Chakravarthy.V

    M 1 Reply Last reply
    0
    • U User 1804931

      Can anybody please tell me what is the Life Cycle of the UserControls. Because I exposed some propterties(Set properties) in my user control, I want to set the properties of the usercontrol from my WebFrom at design time and the values are not assigning.I am doing this by in pageLoad event of WebForm page. Please tell me where I find the life cycle of the usercontrols. Regard, Chakravarthy.V

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, You can take a look at Control Execution Lifecycle[^]. A web user control basically has limited support at design time, so if you want to assign a value to a public property of the user control, you can do that in the html editor, it can get done in the same way as other properties such as ID.... If you still cannot figure out, you may want to post a snippet of your sample code.

      U 1 Reply Last reply
      0
      • M minhpc_bk

        Hi there, You can take a look at Control Execution Lifecycle[^]. A web user control basically has limited support at design time, so if you want to assign a value to a public property of the user control, you can do that in the html editor, it can get done in the same way as other properties such as ID.... If you still cannot figure out, you may want to post a snippet of your sample code.

        U Offline
        U Offline
        User 1804931
        wrote on last edited by
        #3

        Hi, This is the code that I written. I created one UserControl named UserControl1 this control contains one DropDownListBox, in this control I exposed one property named TableName. In the Page_Load() event of the UserControl I am calling SP_TABLE storedprocedure which takes TableName as a parameter. I am using this UserControl in my WebForm1 Page, and in the Page_Load event of the WebForm1 page I am setting the TableName property of the UserControl1 like this.TestControl is the Id of the UserControl1 in WebForm1. Control _myUC = this.FindControl("TestControl"); UserControl1 c = ((UserControl1)_myUC); c.TableName ="Currency_Master"; but this is code is not working, and If I set the TableName property in HTML editor it is working fine, is there anyting wrong in the code. Please help me out. Regards, Chakravarthy.V

        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