UpdatePanelRenderMode 열거형

정의

페이지에서 UpdatePanel 컨트롤의 내용에 적용할 수 있는 레이아웃 렌더링 옵션을 나타냅니다.

public enum class UpdatePanelRenderMode
public enum UpdatePanelRenderMode
type UpdatePanelRenderMode = 
Public Enum UpdatePanelRenderMode
상속
UpdatePanelRenderMode

필드

Block 0

UpdatePanel 컨트롤의 내용을 HTML <div> 요소 안에 렌더링하도록 지정합니다.

Inline 1

UpdatePanel 컨트롤의 내용을 HTML <span> 요소 안에 렌더링하도록 지정합니다.

예제

다음 예제에서는 선언적으로 설정 하는 방법에 설명 합니다 UpdatePanel.RenderMode 속성을 합니다 Inline. UpdatePanel 컨트롤 포함 페이지에서 포스트백 수를 나타내는 문자열입니다. 콘텐츠를 둘러싸는 텍스트와 인라인으로 렌더링 됩니다.


<%@ 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
    {
        get
        {
            return (int)(ViewState["PostBackCount"] ?? 0);
        }
        set
        {
            ViewState["PostBackCount"] = value;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            PostBackCount++;
        }
    }

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>UpdatePanelRenderMode Example</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1"
                               runat="server" />
            The number of times you have clicked the button is
            <asp:UpdatePanel ID="UpdatePanel1"
                             UpdateMode="Conditional"
                             RenderMode="Inline"
                             runat="server">
                <ContentTemplate>
                    <%= 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"
                                Text="Increment"
                                runat="server" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </form>
</body>
</html>

<%@ Page Language="VB" %>

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

<script runat="server">
    Protected Property PostBackCount As Integer
        Get
            If Not ViewState("PostBackCount") Is Nothing Then
                Return ViewState("PostBackCount")
            Else : Return 0
            End If
        End Get
        Set(ByVal value As Integer)
            ViewState("PostBackCount") = Value
        End Set
    End Property
    
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If IsPostBack Then
            PostBackCount += 1
        End If
    End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>UpdatePanelRenderMode Example</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1"
                               runat="server" />
            The number of times you have clicked the button is
            <asp:UpdatePanel ID="UpdatePanel1"
                             RenderMode="Inline"
                             runat="server">
                <ContentTemplate>
                    <%= 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"
                                Text="Increment"
                                runat="server" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </form>
</body>
</html>

설명

UpdatePanelRenderMode 의 콘텐츠를 포함 하는 데는 HTML 요소를 정의 하는 열거형은 UpdatePanel 컨트롤입니다. 합니다 UpdatePanel.RenderMode 속성의 값 중 하나 여야 합니다 UpdatePanelRenderMode 열거형입니다. 콘텐츠를 UpdatePanel 컨트롤 중 하나 내에서 HTML 렌더링 될 수 있습니다 <div> 요소 또는 <span> 요소입니다.

기본 RenderMode 속성 값은 입니다 Block.

적용 대상

추가 정보