The other solutions are correct in setting
runat=server
and then hide the div from the server. But the div you intend to hide can contain elements which may be referenced somewhere in your script and your javascript will throw null reference error if they are not there on the page.
To avoid that use the following code:
yourDiv.Style.Add(HtmlTextWriterStyle.Display, "none");
This sets
Display
css property to
none
to hide the div instead of not adding the element entirely.
This approach is much cleaner and safe then just setting visibility to false.