다음을 통해 공유


BulletedList.AutoPostBack 속성

정의

기본 클래스의 AutoPostBack 속성 값을 가져오거나 설정합니다.

public:
 virtual property bool AutoPostBack { bool get(); void set(bool value); };
[System.ComponentModel.Browsable(false)]
public override bool AutoPostBack { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.AutoPostBack : bool with get, set
Public Overrides Property AutoPostBack As Boolean

속성 값

false.

특성

예외

AutoPostBack에 값을 할당하려고 했습니다.

예제

다음 코드 예제에서는 값을 AutoPostBack 속성은 항상 false 에 대 한는 BulletedList 제어 하 고 있으므로이 클래스에 적용 되지 않습니다.

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>AutoPostBack Property Example</title>
<script language="c#" runat="server">

        void Page_Load(Object sender, EventArgs e)
        {
            // Get the value of AutoPostBack for this bulleted list.
            bool value;
            value = ItemsBulletedList.AutoPostBack;

            // This property is not applicable to the BulletedList class.
            // This message will never be displayed.
            if(value)
            {
                Message.Text = "The value of the AutoPostBack property is True.";
            }

            // The default AutoPostBack value inherited from ListControl is False.
            // This message will always be displayed.
            if(!value)
            {
                Message.Text = "The value of the AutoPostBack property is " + value.ToString() + "."
                    + "This property is inherited by the ListControl class."
                    + "It is not applicable to the BulletedList class.";
            }
        }       


    </script>

</head>
<body>

    <h3>AutoPostBack Property Example</h3>

    <form id="form1" runat="server">
                    
        <asp:BulletedList id="ItemsBulletedList" 
            BulletStyle="Disc"
            DisplayMode="Text" 
            runat="server">    
                <asp:ListItem Value="0">The first list item.</asp:ListItem>
            <asp:ListItem Value="1">The second list item.</asp:ListItem>
            <asp:ListItem Value="2">The third list item.</asp:ListItem>
            <asp:ListItem Value="3">The fourth list item.</asp:ListItem>
        </asp:BulletedList>        
        
    <p>        
    <asp:Label id="Message" 
        Font-Size="12"
        Width="368px" 
        runat="server"/></p>
              
    </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">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>AutoPostBack Property Example</title>
<script runat="server">

        Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

            Dim value As Boolean
            ' Get the value of AutoPostBack for this bulleted list.
            value = ItemsBulletedList.AutoPostBack

            ' This property is not applicable to the BulletedList class.
            ' This message will never be displayed.
            If value = True Then
                   Message.Text = "The value of the AutoPostBack property is True."
            End If

             ' The default AutoPostBack value inherited from ListControl is False.
             ' This message will always be displayed.
            If value = False Then
                Message.Text = "The value of the AutoPostBack property is " & value & "." _
                    & "This property is inherited by the ListControl class." _
                    & "It is not applicable to the BulletedList class."
            End If
        End Sub

    </script>

</head>
<body>

    <h3>AutoPostBack Property Example</h3>

    <form id="form1" runat="server">
                    
        <asp:BulletedList id="ItemsBulletedList" 
            BulletStyle="Disc"
            DisplayMode="Text" 
            runat="server">    
                <asp:ListItem Value="0">The first list item.</asp:ListItem>
            <asp:ListItem Value="1">The second list item.</asp:ListItem>
        <asp:ListItem Value="2">The third list item.</asp:ListItem>
        <asp:ListItem Value="3">The fourth list item.</asp:ListItem>
        </asp:BulletedList>        
        
    <p>        
    <asp:Label id="Message" 
        Font-Size="12"
        Width="368px" 
        runat="server"/></p>
                           
    </form>

</body>
</html>

설명

AutoPostBack 속성에서 상속 되는 ListControl 클래스 및에 적용 되지 않습니다는 BulletedList 컨트롤. 값을 할당 하지 마십시오는 AutoPostBack 속성입니다. 값을 할당 수행 하는 경우는 AutoPostBack, NotSupportedException 예외가 throw 됩니다.

적용 대상

추가 정보