UpdatePanelRenderMode Enumeration
Collapse the table of content
Expand the table of content

UpdatePanelRenderMode Enumeration

.NET Framework (current version)

Represents the possible layout rendering options for the content of an UpdatePanel control on a page.

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

public enum UpdatePanelRenderMode

Member nameDescription

Specifies that the content of the UpdatePanel control is rendered inside an HTML <div> element.


Specifies that the content of the UpdatePanel control is rendered inside an HTML <span> element.

The UpdatePanelRenderMode enumeration defines which HTML elements to use to enclose the content of the UpdatePanel control. The RenderMode property must be one of the values of the UpdatePanelRenderMode enumeration. The content of an UpdatePanel control can be rendered inside either an HTML <div> element or a <span> element.

The default RenderMode property value is Block.

The following example shows how to declaratively set the RenderMode property of an UpdatePanel control to Inline. The UpdatePanel control contains a string that represents the number of postbacks from the page. The contents are rendered inline with the surrounding text.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    protected int PostBackCount
            return (int)(ViewState["PostBackCount"] ?? 0);
            ViewState["PostBackCount"] = value;
    protected void Page_Load(object sender, EventArgs e)
        if (IsPostBack)


<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>UpdatePanelRenderMode Example</title>
    <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1"
                               runat="server" />
            The number of times you have clicked the button is
            <asp:UpdatePanel ID="UpdatePanel1"
                    <%= PostBackCount.ToString() %>
                    times. Every time you click the count is incremented. The panel
                    containing the number of times you clicked is rendered in-line.
                    <br />
                    <asp:Button ID="Button1"
                                runat="server" />

.NET Framework
Available since 3.5
Return to top
© 2016 Microsoft