UpdatePanel..::.ContentTemplate Property Home
This page is specific to:.NET Framework Version:3.54.0
.NET Framework Class Library
UpdatePanel..::.ContentTemplate Property

Gets or sets the template that defines the content of the UpdatePanel control.

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

'Usage

Dim instance As UpdatePanel
Dim value As ITemplate

value = instance.ContentTemplate

instance.ContentTemplate = value

'Declaration

<PersistenceModeAttribute(PersistenceMode.InnerProperty)> _
<TemplateInstanceAttribute(TemplateInstance.Single)> _
<BrowsableAttribute(False)> _
Public Property ContentTemplate As ITemplate
<asp:UpdatePanel>
    <ContentTemplate>ITemplate</ContentTemplate>
</asp:UpdatePanel>

Property Value

Type: System.Web.UI..::.ITemplate
An ITemplate instance that defines the content of the UpdatePanel control. The default is nullNothingnullptra null reference (Nothing in Visual Basic).
Exceptions

ExceptionCondition
InvalidOperationException

The ContentTemplate property of the UpdatePanel control is set after an instance of the template is created or after the content template container is created.

Remarks

The ContentTemplate property contains the content that appears inside an UpdatePanel control when it is rendered. You can create the template's content declaratively or programmatically. The content template of an UpdatePanel control is a single-instance template. Therefore, the properties of the controls it contains can be accessed directly on the page without using the FindControl method. For more information, see the TemplateInstanceAttribute class overview.

To add items to the UpdatePanel control declaratively, add an <ContentTemplate> element between the opening and closing tags of the UpdatePanel control. Inside the <ContentTemplate> element tags, declare other controls and HTML elements.

To add items to the UpdatePanel control dynamically, use the ContentTemplateContainer property, which enables you to add child controls without having to create a custom template that implements the ITemplate interface.

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5
See Also

Reference

Other Resources

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View