tags:

views:

18

answers:

2

Hi, I am using HTML control,and want to visible false from the server side with out using attributes runat="Server"

tell me any solution

A: 

Runat="Server" has got nothing to do with visibility.

If you want to hide the control (so that its not visible to any visitors to your site) you would simply set its CSS to visibility:hidden; or display: none;. I think this is what you wanted to know.

m.edmondson
As a clarification: Just adding css will still render the HTML, so it's still there for the customer. Implementing it as ScottE suggests will make it completely invisible for the browser (but I'm pretty sure you knew that).
Patrick
Correct, but without using runat="Server" this is the only option.
m.edmondson
A: 

Wrap your html controls in an asp:placeholder control, and set the visibility on the placeholder.

Example

<asp:placeholder id="plc" runat="server" visible="false">
    <h1>Some Content</h1>
    <img src="/images/someimage.gif" alt="" />
</asp:placeholder>
ScottE
Doesn't he specify it won't be runat="server"? That was my understanding.
m.edmondson
He specifies a control, but not necessarily a container.
ScottE