convert foreign key value in repeater

T

TJS

while creating values in a repeater, I want ot replace the foreign key value
with a text value.

<asp:repeater id="scores" runat="server" OnItemCreated="Scores_itemCreated">
.....
<ItemTemplate>
<tr bgcolor="#EEEEEE"" >
<td><%# container.DataItem("idEvent") %></td>
.....


i was thinking of using OnItemCreated with a query to lookup the text name
and reassign it to be the display but can't figure out how to do this.

Any suggestions ?
 
K

Karl Seguin

OnItemDataBound seems like the smart way to do it:
http://openmymind.net/index.aspx?documentId=8

alternatively, you could use

<%# GetItemName(Container.DataItem("idEvent")) %>

and have a function:

protected string function GetItemName(byval eventId as string)
...
end function

read the tutorial, talks about both methods..

Karl
 
T

TJS

thanks, the function idea works great.

Just a note on your article, the content has to be scrolled back and forth
in order to read it.

I have a high resolution screen , 15 in monitor and it still didn't fit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top