Name

UserControl

Synopsis

This class represents a user control, or .ascx file, inside a Web Form. A user control allows you to share commonly used portions of user interface. User controls are similar to .aspx pages and can contain HTML, server controls, and event handling logic. They are instantiated and cached in much the same was as Page objects and contain many of the same properties. The difference is that user controls must be situated inside a Web Forms page. User controls should not be confused with custom web controls, which you can create by inheriting from System.Web.UI.WebControls.WebControl.

When using fragment caching with user controls, remember that you will not be able to modify any of the properties of the UserControl; the cached control will be loaded as straight HTML rather than a UserControl object.

Public Class UserControl : Inherits TemplateControl : Implements_
        IAttributeAccessor, IUserControlDesignerAccessor
' Public Constructors
   Public Sub New() 
' Public Instance Properties
   Public ReadOnly Property Application As HttpApplicationState  
   Public ReadOnly Property Attributes As AttributeCollection  
   Public ReadOnly Property Cache As Cache  
   Public ReadOnly Property IsPostBack As Boolean  
   Public ReadOnly Property Request As HttpRequest  
   Public ReadOnly Property Response As HttpResponse  
   Public ReadOnly Property Server As HttpServerUtility  
   Public ReadOnly Property Session As HttpSessionState  
   Public ReadOnly Property Trace As TraceContext  
' Public Instance Methods Public ...

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.