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
GetCreateUserPageLink(UserAuthenticationViewModel)
Gets the resolved link to the “create user” page, if defined in settings.
public static string? GetCreateUserPageLink(this UserAuthenticationViewModel model)
Parameters
modelUserAuthenticationViewModelThe UserAuthenticationViewModel instance from the template.
May benull.
Returns
- string
The CreateUserLink value if available;
otherwisenull.
Remarks
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.