LoginView.AnonymousTemplate 속성

정의

웹 사이트에 로그인하지 않은 사용자에게 표시할 템플릿을 가져오거나 설정합니다.

public:
 virtual property System::Web::UI::ITemplate ^ AnonymousTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };
[System.ComponentModel.Browsable(false)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
[System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.LoginView))]
public virtual System.Web.UI.ITemplate AnonymousTemplate { get; set; }
[<System.ComponentModel.Browsable(false)>]
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
[<System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.LoginView))>]
member this.AnonymousTemplate : System.Web.UI.ITemplate with get, set
Public Overridable Property AnonymousTemplate As ITemplate

속성 값

ITemplate

표시할 ITemplate입니다.

특성

예제

다음 코드 예제에 지정 된 템플릿을 사용 하는 AnonymousTemplate 템플릿을 등록 하 라는 초대장이 표시할 개인 서비스를 설정 합니다.

<%@ 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">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
        <form id="form1" runat="server">
            <table style="text-align:center; width:300px; background-color:#fffacd">
                <tr style="background-color:#dcdcdc">
                    <td>Personal content</td>
                    <td>
                        <asp:LoginStatus id="LoginStatus1" runat="Server"></asp:LoginStatus>
                    </td>
                </tr>
                <asp:LoginView id="LoginView1" runat="server">
                    <AnonymousTemplate>
                        <tr>
                            <td colspan="2">
                                <a href="createUser.aspx">Sign up</a> to personalize your account.
                            </td>
                        </tr>
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        <tr>
                            <td>
                                <asp:LoginName id="LoginName1" runat="Server" 
                                    FormatString="Welcome {0}">
                                </asp:LoginName>
                            </td>
                            <td>
                                <a href="manageAccount.aspx">Edit info...</a>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                * Check email * Add a link * Local weather *
                            </td>
                        </tr>
                    </LoggedInTemplate>
                </asp:LoginView>
            </table>
        </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">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
        <form id="form1" runat="server">
            <table style="text-align:center; width:300px; background-color:#fffacd">
                <tr style="background-color:#dcdcdc">
                    <td>Personal content</td>
                    <td align="right">
                        <asp:LoginStatus id="LoginStatus1" runat="Server"></asp:LoginStatus>
                    </td>
                </tr>
                <asp:LoginView id="LoginView1" runat="server">
                    <AnonymousTemplate>
                        <tr>
                            <td colspan="2">
                                <a href="createUser.aspx">Sign up</a> to personalize your account.
                            </td>
                        </tr>
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        <tr>
                            <td>
                                <asp:LoginName id="LoginName1" runat="Server" 
                                    FormatString="Welcome {0}">
                                </asp:LoginName>
                            </td>
                            <td align="right">
                                <a href="manageAccount.aspx">Edit info...</a>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                * Check email * Add a link * Local weather *
                            </td>
                        </tr>
                    </LoggedInTemplate>
                </asp:LoginView>
            </table>
        </form>
    </body>
</html>

설명

AnonymousTemplate 속성 웹 사이트에 로그인 하지 할 때 웹 사이트 사용자에 게 표시할 콘텐츠 템플릿을 지정 합니다. 이 템플릿이 표시 됩니다 때 합니다 Name 의 속성을 PageUser 속성은 null.

AnonymousTemplate 템플릿이 인증 된 사용자에 게 표시 되지 않습니다. 경우는 AnonymousTemplate 속성이 비어 있는 경우 콘텐츠가 없는 로그인 하지 않은 사용자로 표시 됩니다.

적용 대상

추가 정보