A
Alex Davidson
I have been banging my head against a wall trying to get a server-control to
reference the text of a hidden <asp:label> so for testing I stripped things
down to a bare minimum to try response.write'ing the data to the screen to
see if anything can be seen at all...
I have the following HTML:
<asp:Repeater ID="myRepeater" Runat="server"
OnItemCreated="myRepeater_ItemCreated">
....
<ItemTemplate>
<tr valign="top" ID="BodyRow" runat="server">
<td>
<asp:Label ID="lblImageLabel" Visible="true" Runat=server text=<%#
container.dataitem("ItemETImageFileName") %>><%#
container.dataitem("ItemETImageFileName") %></asp:Label>
</td>
....
</ItemTemplate>
coupled with the following Code-Behind:
Sub myRepeater_ItemCreated(ByVal sender As Object, ByVal e As
RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Header Then
....
ElseIf e.Item.ItemType = ListItemType.Footer Then
....
Else
Dim varImageName As Label
varImageName = CType(e.Item.FindControl("lblImageLabel"), Label)
Response.Write(varImageName.Text & "<BR>")
End if
....
but the response.writes show nothing - can anyone suggest a reason and
solution?
Thanks.
Alex
reference the text of a hidden <asp:label> so for testing I stripped things
down to a bare minimum to try response.write'ing the data to the screen to
see if anything can be seen at all...
I have the following HTML:
<asp:Repeater ID="myRepeater" Runat="server"
OnItemCreated="myRepeater_ItemCreated">
....
<ItemTemplate>
<tr valign="top" ID="BodyRow" runat="server">
<td>
<asp:Label ID="lblImageLabel" Visible="true" Runat=server text=<%#
container.dataitem("ItemETImageFileName") %>><%#
container.dataitem("ItemETImageFileName") %></asp:Label>
</td>
....
</ItemTemplate>
coupled with the following Code-Behind:
Sub myRepeater_ItemCreated(ByVal sender As Object, ByVal e As
RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Header Then
....
ElseIf e.Item.ItemType = ListItemType.Footer Then
....
Else
Dim varImageName As Label
varImageName = CType(e.Item.FindControl("lblImageLabel"), Label)
Response.Write(varImageName.Text & "<BR>")
End if
....
but the response.writes show nothing - can anyone suggest a reason and
solution?
Thanks.
Alex