Conditional logic in ItemTemplate

I'm sure this is way easier than I'm making it out to be, but I'm stuck...  I'm using a grid control by Obout - it's very similar to the grid.  In the Item template (called GridTemplate in this control), I want to truncate a time value.  In the database the time is stored as 01:01.123.  I simply want to display 01:01

I use the Substring function to do this, but it will bomb if there is no time value.  So how do I check that within a GridTemplate?  It doesn't recognize the Container object when I use it in my If statement.  Please advise.  

The code below obviously did work -

Thanks -

<cc1:GridTemplate runat="server" ID="tmpDuration">
                        <% if ( Container.Value.Length > 4){ %>
                            <%# Container.Value.Substring(0, 5)%> 

Open in new window

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

lazyberezovskyConnect With a Mentor Commented:
You can use ?: operator
 <%# ( Container.Value.Length > 4) ?  Container.Value.Substring(0, 5) : Container.Value %>                      
All Courses

From novice to tech pro — start learning today.