Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to display none through code behind

I have tried this

login_div.Style("display") = "none";

But it's not working.how can I set the display of the div to none through code behind, in aspx I have a div:

<div id="login_div" runat="server">
like image 318
Mishigen Avatar asked Dec 10 '09 16:12

Mishigen


People also ask

How do you set display none in code behind?

Add("style","display:none"); div_id: id which you want to hide. Attributes: that will use value. Add: keyword will add the attribute.

How do I set display to none in HTML?

display = "none"; To show an element, set the style display property to “block”.

What is the reverse of display none?

opposite of 'none' is 'flex' while working with react native. Show activity on this post. visibility:hidden will hide the element but element is their with DOM. And in case of display:none it'll remove the element from the DOM.

What is code behind mode?

Code-behind refers to code for your ASP.NET page that is contained within a separate class file. This allows a clean separation of your HTML from your presentation logic. The following sample illustrates an ASP.NET code-behind page: MyCodebehind.aspx.


2 Answers

I believe this should work:

login_div.Attributes.Add("style","display:none");
like image 64
Mark Sherretta Avatar answered Oct 17 '22 17:10

Mark Sherretta


Try if this works:

Panel2.Style.Add("display", "none");
like image 13
shyam sundar Avatar answered Oct 17 '22 17:10

shyam sundar