Notifications
                
            
                Clear all
    
            
        
                                        0                                    
                                15/07/2021 6:44 pm
	                             Topic starter
                                
                            Step 1 - Create User control with fields
Step 2- On Parent page create one div with id and runat server
Step 3- In parent page, code behind file write the below code to add user control
Control ctrl =Page.LoadControl("PathOfUserControl");
dvUcControl.Controls.Clear();
dvUcControl.Controls.Add(ctrl);
To get fields from User control , just refer the below code
example- Textbox
TextBox txt=ctrl.FindControl("IdOfTextbox") as TextBox;
txt.Text="Working demo";
This topic was modified 4 years ago by dotnet
