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 Attributes Dictionary<String,Object>
attribute
inner element
static value
bindable
default
null
property icon AuthenticatedTemplate ITemplate Gets or sets the content displayed to the authenticated users.
attribute
inner element
static value
bindable
default
null
property icon ClientIDMode ClientIDMode Gets or sets the client ID generation algorithm.
attribute
inner element
static value
bindable
default
Static
property icon DataContext Object Gets or sets a data context for the control and its children. All value and command bindings are evaluated in context of this value.
attribute
inner element
static value
bindable
default
null
property icon ID String Gets or sets the unique control ID.
attribute
inner element
static value
bindable
default
null
property icon InnerText String Gets or sets the inner text of the HTML element.
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 Visible Boolean Gets or sets whether the control is visible.
attribute
inner element
static value
bindable
default
True
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>