Nested master page and control resolution¶
This operation walks a chain of nested ASP.NET master pages to count nesting depth, locate a specific ancestor master, or recursively find a control inside a named content placeholder anywhere in the master chain.
| Field | Value |
|---|---|
| Operation ID | OP-CORE-014 |
| Trigger | Consuming page or control needs a control that lives in an ancestor master page |
| Inputs | Page, control ID, optional content placeholder ID |
| Outputs | MasterPage or Control reference |
| Primary components | clsNestedMaster.MasterLevelCount, clsNestedMaster.Root, clsNestedMaster.FindMaster, clsNestedMaster.FindControl |
| Entry point | SAIF.Presentation.Web.Core.Infragistics111/clsNestedMaster.vb |
Steps¶
MasterLevelCountrecurses frompage.Masterupward, counting levels until a master with no parent master is reached. (BR-CORE-035)FindMasterrecurses to the requested ancestor level (default 1);Rootreturns the outermost master.FindControlstarts from the root master and recursively walks the control tree, returning the first control found inside aContentPlaceHolderwhoseIDmatchescontentPlaceHolderID. (BR-CORE-036)- If the recursive search yields nothing, fall back to a direct
FindControlon the root master. (BR-CORE-037)
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([FindControl / FindMaster / MasterLevelCount called]) --> S1[Recurse from page.Master upward]
S1 --> S2[MasterLevelCount: count until master with no parent]
Start --> S3[FindMaster: recurse to requested ancestor level, default 1]
S3 --> S4[Root: returns outermost master]
Start --> S5[FindControl: walk from root master downward]
S5 --> D1{Control found in matching ContentPlaceHolder?}
D1 -->|Yes| EndOk([Return matched control])
D1 -->|No| S6[Fallback: direct FindControl on root master]
S6 --> EndFallback([Return fallback result, possibly Nothing])
Failure and edge-case behavior¶
- If both the recursive search and the fallback
FindControlon the root master fail,FindControlreturnsNothingto the caller, which must itself guard against a null control reference.**
Related documentation¶
Sources¶
SAIF.Presentation.Web.Core.Infragistics111/clsNestedMaster.vb