AuthenticatedView

in namespace DotVVM.Framework.Controls

Renders different content to the users that are authenticated and users that are not.

Usage & Scenarios

Allows to display different content to users that are authenticated and users that are not.

Sample 1: AuthenticatedView

The AuthenticatedTemplate property defines the content for users who are authenticated. The NotAuthenticatedTemplate property defines the content for users who are not authenticated.

You have to specify at least one of the templates.

<dot:AuthenticatedView>
  <AuthenticatedTemplate>
    I am authenticated.
  </AuthenticatedTemplate>
  <NotAuthenticatedTemplate>
    I am not authenticated.
  </NotAuthenticatedTemplate>
</dot:AuthenticatedView>

Properties

Name Type Description Notes Default Value
property icon AuthenticatedTemplate ITemplate Gets or sets the content displayed to the authenticated users.
attribute
inner element
static value
bindable
default
null
property icon NotAuthenticatedTemplate ITemplate Gets or sets the content displayed to the users that are not authenticated.
attribute
inner element
static value
bindable
default
null
property icon RenderWrapperTag Boolean Gets or sets whether the control should render a wrapper element.
attribute
inner element
static value
bindable
default
False
property icon WrapperTagName String Gets or sets the name of the tag that wraps the Repeater.
attribute
inner element
static value
bindable
default
div

HTML produced by the control

The control renders the contents of the AuthenticatedTemplate or NotAuthenticatedTemplate property. Optionally you can enable wrapper tag rendering using the RenderWrapperTag property. The tag name can be changed using the WrapperTagName property.

<div>
    <!-- Contents of the AuthenticatedTemplate or NotAuthenticatedTemplate -->
</div>