MSJD.FormSaver
1.0.5
dotnet add package MSJD.FormSaver --version 1.0.5
NuGet\Install-Package MSJD.FormSaver -Version 1.0.5
<PackageReference Include="MSJD.FormSaver" Version="1.0.5" />
<PackageVersion Include="MSJD.FormSaver" Version="1.0.5" />
<PackageReference Include="MSJD.FormSaver" />
paket add MSJD.FormSaver --version 1.0.5
#r "nuget: MSJD.FormSaver, 1.0.5"
#:package MSJD.FormSaver@1.0.5
#addin nuget:?package=MSJD.FormSaver&version=1.0.5
#tool nuget:?package=MSJD.FormSaver&version=1.0.5
FormSaver for Blazor
Advanced FormSaver Demo | LocalStorage + Encryption
FormSaver is a Blazor service that enables automatic saving, restoring, and encryption of complex form data in the browser's local storage. It supports nested objects, offline draft saving, and secure storage without requiring a backend.
Features
- 💾 Form Saving – Save form state locally using a custom button click.
- 🔄 Restore Forms Instantly – Load previously saved form data anytime.
- 🔐 Built-in Encryption – All data stored locally is encrypted for security.
- 🏗 Supports Nested Objects – Handles complex forms with nested structures.
- 🌐 Offline Friendly – No backend required; perfect for offline forms or drafts.
- 🧰 Blazor Integration – Works seamlessly with
EditForm,InputText,InputSelect,InputCheckbox, andInputDate. - ⚡ Compatible with All Render Modes – Works with
InteractiveServer,InteractiveWebAssembly, and standard Blazor server/client render modes.
Demo Preview
Try it live: FormSaver Demo
Simple Example
Inject the service in Program.cs:
builder.Services.AddFormSaver();
Razor component example:
@page "/simple-form"
@inject IFormSaver FormSaver
<EditForm Model="@User">
<DataAnnotationsValidator />
<ValidationSummary />
<label>Full Name:</label>
<InputText @bind-Value="User.FullName" class="form-control" />
<label>Email:</label>
<InputText @bind-Value="User.Email" class="form-control" />
<label>Comment:</label>
<InputTextArea @bind-Value="User.Comment" class="form-control" rows="3" />
<div class="mt-2">
<button type="button" class="btn btn-primary" @onclick="SaveForm">💾 Save</button>
<button type="button" class="btn btn-secondary" @onclick="LoadForm">📂 Load</button>
<button type="button" class="btn btn-danger" @onclick="DeleteForm">🗑 Delete</button>
</div>
</EditForm>
@code {
private string Key = "simpleForm";
private UserModel User = new();
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await FormSaver.InitializeAsync();
var saved = await FormSaver.LoadAsync<UserModel>(Key);
if (saved != null) User = saved;
}
}
private async Task SaveForm() => await FormSaver.SaveAsync(Key, User);
private async Task LoadForm() => User = await FormSaver.LoadAsync<UserModel>(Key) ?? new UserModel();
private async Task DeleteForm() => await FormSaver.RemoveAsync(Key);
public class UserModel
{
public string FullName { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
}
}
API
Initialize FormSaver
await FormSaver.InitializeAsync();
Save Form
bool success = await FormSaver.SaveAsync("formKey", User);
Load Form
var model = await FormSaver.LoadAsync<UserModel>("formKey");
Delete Form
bool success = await FormSaver.RemoveAsync("formKey");
Important Note
FormSaver stores form data in browser local storage.
Do not try to save forms that include file uploads (images, PDFs, etc.), because files cannot be stored in local storage.
If your form contains files, exclude them or handle file uploads separately.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.AspNetCore.Components.Web (>= 6.0.0)
-
net7.0
- Microsoft.AspNetCore.Components.Web (>= 7.0.0)
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.0)
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.5 | 179 | 10/30/2025 |