How to hide a user control and delete it

I want to hide the user control in asp.net and delete it. How?

+5
source share
4 answers
yourUserControl.Visible=false;

it will not make your user control

+5
source

If you need to make this control visible later from javascript than in server-side code, you can hide it using:

YourControl.Style.Add("display", "none");

but if you don't need to make it visible from javascript, just set its Visible property to false.

, , , , , , javascript.

+3

, :

1) = "display: none"

<asp:TextBox runat="server" id="MyTextBox" style="display:none" />

, .

2) visible = "false"

<asp:TextBox runat="server" id="MyTextBox" visible="false" />

. .

+1

set style = "display: none" to the element that contains your custom control.

0
source

All Articles