My ZoneX

Waiting for Blogger Beta2!!

Monday, January 02, 2006

Rpt - FormatWhiteSpace

In HTML,
<asp:Repeater id="Repeater1" runat="server">
<HeaderTemplate>
<table cellpadding=0 cellspacing=0 border=1>
<tr>
<td>Product Name</td>
<td>Unit Price</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "ProductName") %></td>
<td><%# FormatWhiteSpace(DataBinder.Eval(Container.DataItem, "UnitPrice")) %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

In vb,


''Change [ null,0 ] to ""

Protected Function FormatWhiteSpace(ByVal argVal) As String

     If argVal Is DBNull.Value Then

         Return " "

     ElseIf argVal = 0 Then

        Return " "

     Else

         Return argVal

     End If

End Function



 



0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home