---
title: "Hide div if Eval value of control is null"  
description: "Hide div if Eval value of control is null"  
author: "Anonymous User"  
published: 2015-03-24  
updated: 2015-03-24  
canonical: https://www.mindstick.com/forum/23047/hide-div-if-eval-value-of-control-is-null  
category: "javascript"  
tags: ["jquery", "mvc"]  
reading_time: 1 minute  

---

# Hide div if Eval value of control is null

Is there a way to hide the div containing the RadBinaryImage if the bind [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) "Pic" is [null](https://www.mindstick.com/forum/33922/how-to-use-null-coalescing-operator-in-c-sharp)?

```
<div class="photo-container"> <telerik:RadBinaryImage runat="server"
ID="RadBinaryImage1" DataValue='<%# Eval("Pic") ==DBNull.Value? new System.Byte[0]: Eval("Pic") %>' AutoAdjustImageControlSize="false"Width="300px"  AlternateText='<%#Eval("PicName")%>' /></div>
```

## Replies

### Reply by Anonymous User

You can do it like this.

visible attribute will return false if the value is null and it will return true if the value is not null.

```
<div class="photo-container" visible='<%#Eval("Pic") == DBNull.Value ? false : true %>'> <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("Pic") == DBNull.Value? new System.Byte[0]:
Eval("Pic") %>' AutoAdjustImageControlSize="false" Width="300px"  AlternateText='<%#Eval("PicName")%>' /></div>
```


---

Original Source: https://www.mindstick.com/forum/23047/hide-div-if-eval-value-of-control-is-null

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
