collect-user-input

仓库创建 2026年2月4日最近提交 18 小时前SkillHot 收录 20 天前
▸ 精选理由

涵盖多种交互模式与验证方式,适合实现复杂表单与交互逻辑。

这个 Skill 做什么

在 Blazor 中构建表单、数据验证与用户输入绑定的实现策略与模式。

帮你在 Blazor 里快速做表单交互:从输入绑定、文件上传到校验和提交流程都能覆盖。适合要加搜索框、过滤面板、内联编辑或完整数据录入页的时候用。特别之处是同时包含客户端常见的 @bind 与 EditForm 模式,也讲清了 SSR 场景下(如 FormName、SupplyParameterFromForm、AntiforgeryToken)的做法和自定义校验(DataAnnotationsValidator)策略。

▸ 展开 SKILL.md 英文原文

Build forms, validate data, and react to user input in Blazor. USE FOR adding forms, search boxes, filter panels, inline editing, data-entry UI, file uploads, validation (annotations or custom), handling form submissions, and binding input controls. Covers EditForm, built-in input components, DataAnnotationsValidator, custom validation, SSR form patterns (SupplyParameterFromForm, FormName, AntiforgeryToken, Enhance), and @bind for simple interactive controls. DO NOT USE for project scaffolding (see create-blazor-project) or prerendering issues (see support-prerendering).

开发编程表单验证Blazor通用
4.8k
Stars
351
Forks
40
仓库内 Skill
+610
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-blazor/skills/collect-user-input/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-blazor/skills/collect-user-input/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Collect User Input

## Step 1 — Read the Project's AGENTS.md

Check `AGENTS.md` for **Interactivity Mode** and **Interactivity Scope**. This determines which form patterns apply:

| Mode | Form mechanism |
|------|---------------|
| None (Static SSR) | `EditForm` with `FormName` + `[SupplyParameterFromForm]`. No `@bind`, no `@onchange`. |
| Server | `EditForm` with `@bind-Value`. Full interactivity — real-time validation, dynamic UI. |
| WebAssembly | Same as Server, but validators needing server data must call APIs. |
| Auto | Same as WebAssembly — code must work in both browser and server. |

| Scope | Impact |
|-------|--------|
| Global | All forms are interactive. `FormName` only need
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有