Repeater Question

M

Mick Walker

Hi All,

I am using a repeater to display messages to users within my website. I
get the messages by binding a SqlDataSource to the repeater, and
accessing them directly from the database.
However, in my messages database, I only store the GUID of the user whom
sent the message.

Currently I bind the data to the repeater as so:
<ItemTemplate>
<tr>
<td align="left" valign="top"><asp:label
ID="lblDate" Text='<%#Eval("DateSent") %>' runat="server"></asp:label></td>
<td align="left" valign="top"><asp:Label
ID="lblfrom" Text='<%#Eval("FromID") %>' runat="server"></asp:Label></td>
<td align="left" valign="top"><asp:label
ID="lblSubject" Text='<%#Eval("Subject") %>'
runat="server"></asp:label><asp:TextBox ID="txtMsgID" runat="server"
Visible="false" Text='<%#Eval("ID") %>' /></td>
<td align="left" valign="top">
<asp:CheckBox ID="chkAction"
runat="server" />
</td>
</tr>
</ItemTemplate>

This obviously only gives me the user ID of the person whom sent the
message.

Is there any way, within my codebehind I could create a function such as:

Public Function GetUserName(byval UserID as Guid) as string
look up the users username in the access table, by their GUID

Return the Username
End Function

And then call this function from my markup(within the repeater
itemtemplate)then bind the return value to the repeater?

Kind Regards
Mick Walker
 

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,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top