Skip to content

P1: ContentTemplate Unwrapper Transform #558

@csharpfritz

Description

@csharpfritz

Priority: P1 (Transforms)

Problem

ASCX files with templated controls (Repeater, DataList, GridView) use , , blocks. Layer 1 leaves these unchanged, requiring manual conversion to Blazor RenderFragment syntax.

Scope

  • Detect templated control blocks
  • Extract template children
  • Rewrite template expressions: <%# Eval(...) %> → @item.Property
  • Add Context= parameter to item templates
  • Convert Web Forms binding syntax to Blazor

Deliverables

  1. ContentTemplateUnwrapperTransform in src/BlazorWebFormsComponents.Cli/Transforms/Markup/
  2. Template expression rewriter (Eval, GetValue, XPath handling)
  3. Register in Program.cs and test pipeline
  4. Unit tests: tests/BlazorWebFormsComponents.Cli.Tests/Transforms/Markup/ContentTemplateUnwrapperTransformTests.cs
  5. Integration test with real ASCX controls

Acceptance Criteria

✅ Templates unwrapped to Blazor equivalents
✅ Data-binding expressions rewritten correctly
✅ Context= parameter added to item templates
✅ Non-template markup preserved
✅ Warnings emitted for unsupported patterns
✅ Unit tests pass
✅ Integration test shows reduced L2 repair time

Related Track Document

See dev-docs/control-migration/track-contenttemplate.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions