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 | |
---|---|---|---|---|---|
AuthenticatedTemplate | ITemplate | Gets or sets the content displayed to the authenticated users. |
inner element
static value
bindable
default
|
null | |
ClientIDMode | ClientIDMode | Gets or sets the client ID generation algorithm. |
attribute
static value
|
1 | |
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
static value
bindable
|
null | |
ID | String | Gets or sets the unique control ID. |
attribute
static value
|
null | |
InnerText | String | Gets or sets the inner text of the HTML element. |
attribute
static value
bindable
|
null | |
NotAuthenticatedTemplate | ITemplate | Gets or sets the content displayed to the users that are not authenticated. |
inner element
static value
bindable
|
null | |
RenderWrapperTag | Boolean | Gets or sets whether the control should render a wrapper element. |
attribute
static value
|
False | |
Visible | Boolean | Gets or sets whether the control is visible. |
attribute
bindable
|
True | |
WrapperTagName | String | Gets or sets the name of the tag that wraps the Repeater. |
attribute
static value
|
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>