ASP.NET Show Div Conditionally

weilily

New Member
I have googled this and didn't find what I needed. All of the existing solutions I found say to set "visibility" to false. This will not seem to work for me as my application renders PDF which simply "hides" the DIV and leaves a big white space in it's place.Instead, I would like to not render the HTML at all. For instance, in PHP, this could be done as simply as:\[code\]<?php if ($showDiv == true) { ?><div>Lorem ipsum dolor sit amet</div><?php } ?>\[/code\]In ASP.NET MVC, I could simply pass a ViewBag variable and do the same thing.What is the solution for this in ASP.NET (C#)?
 
Back
Top