Table of Contents

Class UserAuthenticationViewModelExtensions

Namespace
Dynamicweb.Users.Frontend.UserAuthentication
Assembly
Dynamicweb.Users.dll

Extension methods for UserAuthenticationViewModel.

public static class UserAuthenticationViewModelExtensions
Inheritance
UserAuthenticationViewModelExtensions
Inherited Members

Examples

Razor template usage:

@inherits ViewModelTemplate<Dynamicweb.Users.Frontend.UserAuthentication.UserAuthenticationViewModel> @using Dynamicweb.Users.Frontend.UserAuthentication

@if (!string.IsNullOrEmpty(Model.GetCreateUserPageLink())) { <a href="@Model.GetCreateUserPageLink()" class="btn btn-secondary"> Create account </a> }

Remarks

These helpers simplify retrieving links stored in UserAuthenticationViewModel.
The most common usage is calling GetCreateUserPageLink(UserAuthenticationViewModel) in a Razor template to render a “Create account” link.

Methods

Gets the resolved link to the “create user” page, if defined in settings.

public static string? GetCreateUserPageLink(this UserAuthenticationViewModel model)

Parameters

model UserAuthenticationViewModel

The UserAuthenticationViewModel instance from the template.
May be null.

Returns

string

The CreateUserLink value if available;
otherwise null.

This is a safe accessor — it returns null if the model itself is null
or if the CreateUserLink is empty. Use it in templates to render optional
“Create account” actions only when configured.

See Also

To top