Table of Contents

Class UserForgotPasswordViewModelExtensions

Namespace
Dynamicweb.Users.Frontend.UserForgotPassword
Assembly
Dynamicweb.Users.dll

Extension helpers for building UserForgotPassword action links.

public static class UserForgotPasswordViewModelExtensions
Inheritance
UserForgotPasswordViewModelExtensions
Inherited Members

Examples

Razor template usage:

@inherits ViewModelTemplate<Dynamicweb.Users.Frontend.UserForgotPassword.UserForgotPasswordViewModel> @using Dynamicweb.Users.Frontend.UserForgotPassword

@{ var recoverAction = Model.GetRecoverPasswordLink(Pageview.Page.ID); // "/?ID=123&Cmd=RecoverPassword" var changeAction = Model.GetChangePasswordLink(Pageview.Page.ID); // "/?ID=123&Cmd=ChangePassword" }

<form method="post" action="@recoverAction"> ... </form> <form method="post" action="@changeAction"> ... </form>

Remarks

These helpers generate URLs that target the module with the correct command. Use GetRecoverPasswordLink(UserForgotPasswordViewModel, int) for the reset step (?Cmd=RecoverPassword) and GetChangePasswordLink(UserForgotPasswordViewModel, int) for the change step (?Cmd=ChangePassword).

Use the returned URLs as form actions for POST requests. The change-password page is typically reached via an emailed link that includes a RecoveryToken in the page URL (not in the form action).

Methods

Returns an action URL for the change step (?Cmd=ChangePassword).

public static string? GetChangePasswordLink(this UserForgotPasswordViewModel model, int pageId)

Parameters

model UserForgotPasswordViewModel

The UserForgotPasswordViewModel instance.

pageId int

The page ID hosting the module.

Returns

string

A URL like /?ID={pageId}&Cmd=ChangePassword, or null if model is null.

Returns an action URL for the reset step (?Cmd=RecoverPassword).

public static string? GetRecoverPasswordLink(this UserForgotPasswordViewModel model, int pageId)

Parameters

model UserForgotPasswordViewModel

The UserForgotPasswordViewModel instance.

pageId int

The page ID hosting the module.

Returns

string

A URL like /?ID={pageId}&Cmd=RecoverPassword, or null if model is null.

See Also

To top