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">
Add("style","display:none"); div_id: id which you want to hide. Attributes: that will use value. Add: keyword will add the attribute.
display = "none"; To show an element, set the style display property to “block”.
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.
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.
I believe this should work:
login_div.Attributes.Add("style","display:none");
Try if this works:
Panel2.Style.Add("display", "none");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With