Edit User
For users to edit and update user information, or to delete user account
The Users - Edit user app renders a frontend profile form and handles updating the current user (or, when invoked with a user secret, another user) as well as account deletion.
Note
Template location: /Templates/Users/UserEdit/Edit
What the app does
When the app is running on a paragraph it renders an edit profile form. When the form is submitted, the module shows the validation results in the template and on success performs the requested action and redirects.
The actions possible are:
- Update user (
?Cmd=UpdateUser): updates the user with the submitted fields. On success the request redirects (usually back to the referrer) and a success message is displayed - Delete user (
?Cmd=DeleteUser): deletes the user. If the deleted user is the current user, the browser is redirected to the log‑off page, otherwise back to the edit page
The template receives a UserEditViewModel with:
User– a nestedUserViewModelcontaining editable fields (e.g.,Email,Name,FirstName,LastName, address fields, phones, etc.).SelectableUserGroups– an optional list of groups you can render as checkboxes to add/remove the user from.Result– the outcome of the most recent operation:None,Success, orInvalidEmail.
Paragraph app settings

From the paragraph app you have these settings as an editor:
- Templates
- Edit user template: choose a Razor template from
/Templates/Users/UserEdit/Edit.
- Edit user template: choose a Razor template from
- User groups
- Groups the new user can be added to: groups offered as checkboxes in your template (optional).
Edit template
Place a .cshtml file in /Templates/Users/UserEdit/Edit. The template should inherit ViewModelTemplate<UserEditViewModel> and import the Dynamicweb.Users.Frontend.UserEdit namespace.
Minimal example
@inherits ViewModelTemplate<Dynamicweb.Users.Frontend.UserEdit.UserEditViewModel>
@using Dynamicweb
@using Dynamicweb.Rendering
@using Dynamicweb.Users.Frontend.UserEdit
<!-- Create the links for update or delete user information -->
@{
var updateAction = Model.GetEditUserLink(Pageview.Page.ID);
var deleteAction = Model.GetDeleteUserLink(Pageview.Page.ID);
}
<!-- Create a form that displays properties from the ViewModel -->
<form method="post" action="@updateAction">
<div class="grid">
<div class="form-control">
<label for="Name">Name</label>
<input type="text" id="Name" name="Name" value="@Model.User.Name" />
</div>
<div class="form-control">
<label for="Email">Email</label>
<input type="email" id="Email" name="Email" value="@Model.User.Email" required />
</div>
<div class="form-control">
<label for="Phone">Phone</label>
<input type="tel" id="Phone" name="Phone" value="@Model.User.Phone" />
</div>
<!-- Optional: render selectable groups -->
@if (Model.SelectableUserGroups?.Any() == true) {
<fieldset class="form-control">
<legend>Groups</legend>
@foreach (var g in Model.SelectableUserGroups) {
<label><input type="checkbox" name="UserGroupIds" value="@g.Id" /> @g.Name</label>
}
</fieldset>
}
</div>
<div class="actions">
<button type="submit" id="SaveUserButton">Save changes</button>
</div>
<!-- Show a result if present-->
@if (Model.Result != Dynamicweb.Users.Frontend.UserEdit.UserEditResultType.None) {
<p class="form-message">@Translate(Model.Result.ToString())</p>
}
</form>
<form method="post" action="@deleteAction" onsubmit="return confirm('Delete your account? This cannot be undone.');">
<button class="btn btn-danger" type="submit" id="DeleteUserButton">Delete account</button>
</form>
Handling results in your template
Use Model.Result to show a success/error message or to drive UI changes.
@switch (Model.Result)
{
case Dynamicweb.Users.Frontend.UserEdit.UserEditResultType.None:
break;
case Dynamicweb.Users.Frontend.UserEdit.UserEditResultType.Success:
<div class="success">Your changes have been saved.</div>
break;
case Dynamicweb.Users.Frontend.UserEdit.UserEditResultType.InvalidEmail:
<div class="error">Please enter a valid email address.</div>
break;
}
How field binding & redirects work
- Field names: Post inputs using simple user property names (e.g.,
Email,Name,FirstName,LastName,Address,Phone). Legacy names likeUserManagement_Form_Emailare also accepted. - Group relations: When you post selected group IDs (e.g.,
UserGroupIds), the module updates the user’s group memberships according to the editor‑configured selectable groups. - Redirects after save: After a successful save, the app redirects to the referrer when available; otherwise back to the current page. A short‑lived flag ensures the next GET shows a success message.
- Deleting: Deleting the current user redirects to the built‑in logoff page; deleting someone else redirects back to the edit page.
Editing another user (admin flow)
The edit/delete links include a Secret parameter when the view model contains a target user ID. This allows pages to operate on a specific user record (e.g., in an admin or impersonation context). Your template obtains the correct URLs via Model.GetEditUserLink(PageId) / Model.GetDeleteUserLink(PageId); avoid constructing URLs manually.