0

is there way to change a <div> style arrtibute from the code behind?

for example how do i change the display of<div ID="id1" style="display:"none"> to be diplay:"" in asp.net?

Tnx for the help

Omer
  • 307
  • 5
  • 17
  • there is nothing called `""` for `display`, it won't reset the display, you need to override by redeclaring the value like `block` `inline-block` etc – Mr. Alien Feb 07 '14 at 12:16
  • 1
    Possible duplicate of [How do you modify style in the code behind file for divs in ASP.net?](http://stackoverflow.com/questions/657144/how-do-you-modify-style-in-the-code-behind-file-for-divs-in-asp-net) – Dhaval Marthak Feb 07 '14 at 12:17
  • Tnx for help, i used block – Omer Feb 07 '14 at 13:15

1 Answers1

0

Well to access the div from code-behind, it would need to be runat="server" but if it is you just access the style attribute:

id1.Attributes["style"] = "display:\"\"";

but as Mr. Alien writes in the comment to your question, you probably just want to clear it, or set it to block or something.

rusmus
  • 1,665
  • 11
  • 18