views:

151

answers:

1

Hi,

when using asp.net´s visible=false e.g. for a htmlgenericcontrol asp.net renders a newline for a control that is set visible=false.

How to prevent this behavior?

I just have a

<ul> and then 

<li runat="server" id="x"></li> 
<li runat="server" id="x"></li> 
<li runat="server" id="x"></li> 

So one <li> per line. If I set one or all li´s to visible=false by code I get newlines instead of "Nothing"

Thanks.

+2  A: 

Make sure there is no white space (spaces, tabs, new lines) around the control in the aspx page.

Try the following, all in one line:

<ul><li runat="server" id="x"></li><li runat="server" id="x"></li><li runat="server" id="x"></li></ul>
Oded