in my aspx page i have a div id=“testdiv” which whose visibility is hidden on load
from my code behind page i want to make the testdiv visible on fulfiling a certain condition
in codebehind page i am not getting testdiv
its saying its no delcared
<div id=“testdiv” runat=“server” style=“visibility:hidden; background-color:#FFFFFF; color:Green; width:264px; height:100px; top:250px;”>testing</div>
i have this in my aspx page
its working . i removed the css and working fine
the only prblm now is i have a grid in this page
wht i want is when condition is true the results shld be dispalyed in grid and if condition is false div shld be displayed. its wrking fine
the only prblm is when the grid is displayed some space is left out . in that space i have put div
i dont want the grid to move down even if its not visible
Hmmm, im not exactally sure what you are trying to do.
But just something you should know that might help you figure it out. If you use visible=“false” on a runat server control, the control itself will not render at all. So the div will not be in the markup.
If you use the css method u originally did, it will be in the markup, but hidden and will still take up space.
i have a grid and a div on the page
wht i want is when condition is true the results shld be dispalyed in grid and if condition is false div shld be displayed. its wrking fine
the only prblm is when the grid is displayed some space is left out at top . in that space i have put div. though the div is not visible when grid id visible the space is visible
i mean the grid is shifted down
i dont want the grid to move down even if its not visible