Provides a step-by-step workflow for creating Blazor components that emulate ASP.NET Web Forms controls in the BlazorWebFormsComponents library. Covers base class selection (BaseWebFormsComponent, BaseStyledComponent, DataBoundComponent, BaseValidator), Web Forms property and event naming conventions, Playwright integration testing setup, and the complete checklist from component creation through documentation and navigation updates. Use when implementing a new BWFC component, choosing the correct base class for a control type, adding unit or integration tests, or extending an existing component with new Web Forms property support.
71
86%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
This skill covers creating new Blazor components that emulate ASP.NET Web Forms controls.
System.Web.UI.WebControlssrc/BlazorWebFormsComponents/{ComponentName}.razorsrc/BlazorWebFormsComponents/{ComponentName}.razor.csBaseWebFormsComponent - Basic componentsBaseStyledComponent - Components with stylingDataBoundComponent<T> - Data-bound componentssrc/BlazorWebFormsComponents.Test/{ComponentName}/samples/AfterBlazorServerSide/Components/Pages/ControlSamples/{ComponentName}/samples/AfterBlazorServerSide.Tests/docs/{Category}/{ComponentName}.mdsamples/AfterBlazorServerSide/Components/Layout/NavMenu.razor (TreeView)samples/AfterBlazorServerSide/Components/Pages/ComponentList.razor (home page catalog)mkdocs.yml and README.md| Base Class | Use When |
|---|---|
BaseWebFormsComponent | Simple components without styling (Literal, PlaceHolder) |
BaseStyledComponent | Components with visual styling (Label, Panel, Button) |
ButtonBaseComponent | Button-like components (Button, LinkButton, ImageButton) |
DataBoundComponent<T> | Components binding to collections (Repeater, GridView) |
BaseValidator | Validation controls |
Match Web Forms property names exactly:
Text not Label or ContentCssClass not Class or ClassNameNavigateUrl not Href or UrlImageUrl not Src or SourcePrefix with On:
OnClick for click eventsOnCommand for command eventsOnSelectedIndexChanged for selection changesOnDataBinding for data binding eventsEvery component must have integration tests in samples/AfterBlazorServerSide.Tests/ using Playwright:
Page load test in ControlSampleTests.cs:
[Theory] test (EditorControl, DataControl, etc.)Interactive test in InteractiveComponentTests.cs (for interactive components):
Example page load test entry:
[Theory]
[InlineData("/ControlSamples/YourComponent")]
public async Task EditorControl_Loads_WithoutErrors(string path)Example interactive test:
[Fact]
public async Task YourComponent_Interaction_Works()
{
var page = await _fixture.NewPageAsync();
try
{
await page.GotoAsync($"{_fixture.BaseUrl}/ControlSamples/YourComponent");
// Test interactions...
// Assert expected behavior...
}
finally
{
await page.CloseAsync();
}
}Run integration tests with:
dotnet test samples/AfterBlazorServerSide.Tests147d0c4
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.