-
Notifications
You must be signed in to change notification settings - Fork 86
segment element
RobertTheGrey edited this page Jan 12, 2013
·
1 revision
Declares a segment of material passed in to a partial file reference.
Usage: anyXml1<partialFileName><segment name="anyName">anyXml3</segment></partialFileName>anyXml5
Given: anyXml2<render segment="anyName"/>anyXml4
Results in C#:
//anyXml1-generated-code
{
//anyXml2-generated-code
{
//anyXml3-generated-code
}
//anyXml4-generated-code
}
//anyXml5-generated-code
When <render segment=""/>
appears in a partial template it renders the contents of the <segment name="">
contained in the referencing <render partial="">
template. This enables partials to render several distinct micro-templates, for example a repeater partial could have top/bottom/even/odd
named segments.
Usage: anyXml1<partialFileName><segment name="anyName" x="a" y="b">anyXml3</segment></partialFileName>anyXml5
Given: anyXml2<render segment="anyName"/>anyXml4
Results in C#:
//anyXml1-generated-code
{
//anyXml2-generated-code
{
var x = a;
var y = b;
//anyXml3-generated-code
}
//anyXml4-generated-code
}
//anyXml5-generated-code