aspnet-js-aspxclientcontrolbase-dot-setvisible-x28-visible-x29.md
Specifies whether a control is displayed.
SetVisible(
visible: boolean
): void
| Name | Type | Description |
|---|---|---|
| visible | boolean |
true to make a control visible; false to make it hidden.
|
Use the SetVisible method to dynamically define an object’s visible state on the client. The object’s original visibility can be defined by using the object’s ClientVisible property.
Note
If an object’s server Visible property is set to false, this object is not rendered into the web page at all, so it can’t be manipulated on the client side.
The following example illustrates how to use the SetVisible method.
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" Width="30%" ClientInstanceName="fl" ClientVisible="false">
<Items>
<dx:LayoutItem Caption="Layout Item1" ColSpan="1" ShowCaption="True">
<LayoutItemNestedControlCollection>
<dx:LayoutItemNestedControlContainer runat="server">
</dx:LayoutItemNestedControlContainer>
</LayoutItemNestedControlCollection>
</dx:LayoutItem>
<dx:LayoutItem Caption="Layout Item2" ColSpan="1" ShowCaption="True">
<LayoutItemNestedControlCollection>
<dx:LayoutItemNestedControlContainer runat="server">
</dx:LayoutItemNestedControlContainer>
</LayoutItemNestedControlCollection>
</dx:LayoutItem>
</Items>
</dx:ASPxFormLayout>
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="ASPxButton" AutoPostBack="False">
<ClientSideEvents Click="function(s, e) {
fl.SetVisible(!fl.GetVisible());
}" />
</dx:ASPxButton>
See Also