W
Wayne Wengert
I have a bound repeater control on my ASP page and am having a problem
figuring out how to format the output for two different fields. The
Subroutine I am trying to create is listed below. The syntax in that sub to
identify the item being processed and exactly how to format it has me
baffled.
The applicable entries in the ItemTemplate are as follows:
<td align="center"><%# DataBinder.Eval(Container,"DataItem.CGClosed") %>
</td>
and
<td><%# DataBinder.Eval(Container,"DataItem.StartDate") %>) </td>
The first item will always return either a 0 or 1 and in the case of 0 I
want to display "No" and in the case of 1 I want to display "Yes"
For the second item, I simply want to display the short date
Pointers to any information will be appreciated.
Wayne
=========== Sub ================
Sub R1_ItemDataBound(ByVal Sender As Object, ByVal e As
RepeaterItemEventArgs)
If (e.Item.ItemType = ListItemType.Item) Or _
(e.Item.ItemType = ListItemType.AlternatingItem) Then
If CType(e.Item.DataItem,) = "0" Then <== How do I tell it what Item I
want to process/
CType(e.Item.FindControl("CGClosed"), Label).Text = "<b>No</b>"
End If
End If
End Sub
figuring out how to format the output for two different fields. The
Subroutine I am trying to create is listed below. The syntax in that sub to
identify the item being processed and exactly how to format it has me
baffled.
The applicable entries in the ItemTemplate are as follows:
<td align="center"><%# DataBinder.Eval(Container,"DataItem.CGClosed") %>
</td>
and
<td><%# DataBinder.Eval(Container,"DataItem.StartDate") %>) </td>
The first item will always return either a 0 or 1 and in the case of 0 I
want to display "No" and in the case of 1 I want to display "Yes"
For the second item, I simply want to display the short date
Pointers to any information will be appreciated.
Wayne
=========== Sub ================
Sub R1_ItemDataBound(ByVal Sender As Object, ByVal e As
RepeaterItemEventArgs)
If (e.Item.ItemType = ListItemType.Item) Or _
(e.Item.ItemType = ListItemType.AlternatingItem) Then
If CType(e.Item.DataItem,) = "0" Then <== How do I tell it what Item I
want to process/
CType(e.Item.FindControl("CGClosed"), Label).Text = "<b>No</b>"
End If
End If
End Sub