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