I am displaying the results of a database query in a repeater control. I am using alternating item templates so that the background color alternates with each row from the query. That is working nicely.
I would like to "Highlight" one row in the list. This row would be the one whose data item (Building_ID) matches the parameter that was sent to the page when it was loaded.
I tried this code to make the matching item Yellow instead of Blue...
<ItemTemplate>
<tr bgcolor=
<%
If (Request.QueryString("selected_building"
= Container.DataItem("building_id"
) Then
Response.Write("Yellow"
Else
Response.Write("Blue"
End If
%>
>
<td><%#Container.DataItem("building_id"
%></td>
<td><%#Container.DataItem("address"
%></td>
<td><%#Container.DataItem("city"
%></td>
<td><%#Container.DataItem("state"
%></td>
</tr>
</ItemTemplate>
I get an error saying that Container is not declared, yet it seems to know what Container.DataItem("building_id"
is when it displays the data. (if I take out the IF statement that is trying to set the background color).
I might understand this better if I knew what the # is for before the Container.DataItem objects.
Any suggestions ?
I would like to "Highlight" one row in the list. This row would be the one whose data item (Building_ID) matches the parameter that was sent to the page when it was loaded.
I tried this code to make the matching item Yellow instead of Blue...
<ItemTemplate>
<tr bgcolor=
<%
If (Request.QueryString("selected_building"


Response.Write("Yellow"

Else
Response.Write("Blue"

End If
%>
>
<td><%#Container.DataItem("building_id"

<td><%#Container.DataItem("address"

<td><%#Container.DataItem("city"

<td><%#Container.DataItem("state"

</tr>
</ItemTemplate>
I get an error saying that Container is not declared, yet it seems to know what Container.DataItem("building_id"

I might understand this better if I knew what the # is for before the Container.DataItem objects.
Any suggestions ?