Tutorial by Examples

User controls are made for reusability across ASP.NET pages, similar to master pages. Instead of sharing base page layout, user controls share group of HTML/ASP.NET built-in server controls or a specific form layout, e.g. comment submission or guest notes. A user control can contain both HTML contr...
If you want to instantiate an instance of user control inside ASPX code behind page, you need to write user control declaration on Page_Load event as follows: public partial class Default : System.Web.UI.Page { protected void Page_Load(Object sender, EventArgs e) { Control contr...
Like standard ASP.NET built-in server controls, user controls can have properties (attributes) on its definition tag. Suppose you want to add color effect on UserControl.ascx file like this: <uc:UserControl ID="UserControl1" runat="server" Color="blue" /> At t...

Page 1 of 1