Get Control from ‘User Control’ inside .ASPX page


Step 1: create use control with the name of ‘ucControl.ascx’.
Step 2: create one Label control inside user control with name lblWelcome
Step 2: go to .aspx.cs page and write below code on page load and set the value to text box
Label lblMsg = (Label)this.UcControl1.FindControl("lblWelcome");
lblMsg.Text = "Welcome, User";

Comments