Table of Contents

Class UserChangePasswordViewModelExtensions

Namespace
Dynamicweb.Users.Frontend.UserChangePassword
Assembly
Dynamicweb.Users.dll

Extension methods for UserChangePasswordViewModel.

public static class UserChangePasswordViewModelExtensions
Inheritance
UserChangePasswordViewModelExtensions
Inherited Members

Examples

Simple C# usage:

var url = model.GetChangePasswordLink(123);
Console.WriteLine(url); // "/?ID=123&Cmd=ChangePassword"

Razor template usage:

@inherits ViewModelTemplate<Dynamicweb.Users.Frontend.UserChangePassword.UserChangePasswordViewModel> @using Dynamicweb.Users.Frontend.UserChangePassword

var actionUrl = Model.GetChangePasswordLink(Pageview.Page.ID);

<form method="post" action="@actionUrl"> <!-- password fields here --> <button type="submit">Change password</button> </form>

Remarks

These helpers simplify generating links for the change password workflow.
The most common usage is calling GetChangePasswordLink(UserChangePasswordViewModel, int) from within a Razor template to produce a form action URL that triggers the module's password-change handling logic.

Methods

Builds the change password action URL for the given page and model.

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

Parameters

model UserChangePasswordViewModel

The UserChangePasswordViewModel instance from the template.
May be null (in which case the method also returns null).

pageId int

The numeric ID of the page hosting the UserChangePassword module.
Typically retrieved with Pageview.Page.ID inside Razor.

Returns

string

A fully formed relative URL such as /?ID=123&Cmd=ChangePassword if the model is not null;
otherwise, null.

The generated link always includes the query string ?Cmd=ChangePassword.
The module only processes password change attempts on POST requests to this URL.

See Also

To top