This documentation is archived and is not being maintained.

Page.Visible Property

Gets or sets a value indicating whether the Page object is rendered.

[Visual Basic]
Overrides Public Property Visible As Boolean
public override bool Visible {get; set;}
public: __property bool get_Visible();
public: __property void set_Visible(bool);
public override function get Visible() : Boolean;
public override function set Visible(Boolean);

Property Value

true if the Page is to be rendered; otherwise, false. The default is true.


[Visual Basic, C#] The following example sets the Page.Visible property to false to hide the rendered content of a page. When this page is first requested, a data source is populated and displayed in the page. Whe a user clicks the button, the HideButton_Click event handler hides the entire rendered content of the page.

[Visual Basic] 
Sub HideButton_Click(Sender As Object, er As EventArgs)

   Me.Visible = false

End Sub

void HideButton_Click(Object sender, EventArgs er)
   this.Visible = false;

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

Page Class | Page Members | System.Web.UI Namespace