description |
---|
Conditions within portal widgets. |
You can use the <Condition />
component within widgets to optionally display sections of the widget.
Using the ScriptBlock
attribute to define a Script Block to determine the value of the condition. The script block needs to return true or false.
<Condition ScriptBlock="$Errors -eq $null">
</Condition>
The ChildContent
section will be displayed if the condition is true.
<Condition ScriptBlock="$Errors -eq $null">
<ChildContent>
<Alert Message="Success!" />
</ChildContent>
</Condition>
The Else
section will be displayed if the condition is false.
<Condition ScriptBlock="$Errors -eq $null">
<ChildContent>
<Alert Message="Success!" />
</ChildContent>
<Else>
<Alert Message="Failure!" Type="error" ShowIcon="true" />
</Else>
</Condition>