Export (0) Print
Expand All

UpdatePanel.CreateContentTemplateContainer Method

Creates a Control object that acts as a container for child controls that define the UpdatePanel control's content.

Namespace:  System.Web.UI
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

abstract CreateContentTemplateContainer : unit -> Control  
override CreateContentTemplateContainer : unit -> Control

Return Value

Type: System.Web.UI.Control
A Control container for the UpdatePanel control's content.

This method is intended for use by control developers who want to extend the UpdatePanel control. For example, in derived classes, you can provide a different root control that acts as a container for your UpdatePanel control's content. The default implementation returns a Control object.

The following example shows how to override the CreateContentTemplateContainer method in a custom UpdatePanel control to always render the <fieldset> and <legend> elements for the panel's content. The custom UpdatePanel control defines a public property named GroupingText that is a string literal inside the <legend> element.

A custom UpdatePanel control named CustomUpdatePanel derives from UpdatePanel and overrides the CreateContentTemplateContainer method. Put the CustomUpdatePanel class source code in the Web site's App_Code folder.

No code example is currently available or this language may not be supported.

The custom UpdatePanel control is used on the page just as the UpdatePanel control is. The following example shows a page that contains the custom UpdatePanel control.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft