Skip to content

Commit 75ada27

Browse files
csharpfritzCopilot
andcommitted
docs: update Jubilee history with PostBack demo learnings
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3d7ccc0 commit 75ada27

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.squad/agents/jubilee/history.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,3 +473,16 @@ This wave establishes **documentation patterns** that will guide future control
473473
- **Page uses `@inject ClientScriptShim ClientScript`** — injected as scoped service. Calls `FlushAsync(JS)` in `OnAfterRenderAsync` since the page doesn't inherit BaseWebFormsComponent.
474474
- **Pattern:** Source code section at bottom showing complete `@code` block with escaped `@@` directives for display. Follows established migration demo conventions.
475475
- **Build verified:** 0 errors, pre-existing BL0005 warnings only.
476+
477+
### PostBack & ScriptManager Demo Page (ClientScript Phase 2)
478+
479+
- **Created** `samples/AfterBlazorServerSide/Components/Pages/ControlSamples/PostBackDemo/Index.razor` — three-section demo page for Phase 2 ClientScript postback shims.
480+
- **Section 1: GetPostBackEventReference** — button with `onclick="@_postBackScript"` fires `__doPostBack` from JS. PostBack event on WebFormsPageBase receives it server-side. Stable IDs: `postback-button`, `postback-script`, `postback-result`.
481+
- **Section 2: GetPostBackClientHyperlink** — anchor `href="@_postBackHyperlink"` triggers postback via `javascript:__doPostBack(...)` URL. Stable IDs: `postback-link`, `hyperlink-script`, `hyperlink-result`.
482+
- **Section 3: ScriptManager.GetCurrent** — uses `ScriptManagerShim.GetCurrent(this)` to register startup script that writes into `#scriptmanager-target`. Same Web Forms code pattern.
483+
- **Source Code section** at bottom with escaped `@@` directives.
484+
- **Inherits WebFormsPageBase** (not `@inject`) — gives access to `ClientScript`, `PostBack` event, and `ScriptManagerShim.GetCurrent(this)`. This differs from the ClientScriptShim demo which uses `@inject`.
485+
- **Updated** `ComponentCatalog.cs` — added "PostBack Demo" entry in "Migration Helpers" category after "IsPostBack".
486+
- **Updated** `ComponentList.razor` — added PostBack & ScriptManager link in Migration Helpers section.
487+
- **Build verified:** 0 errors, pre-existing BL0005 warnings only.
488+
- **Lesson:** Pages that need the PostBack event must `@inherits WebFormsPageBase`. The ClientScript property is available via inheritance (no separate `@inject` needed). `OnAfterRenderAsync` in WebFormsPageBase handles `FlushAsync` automatically.

0 commit comments

Comments
 (0)