datalist function
I found this fuction on internet.
it checks to see if the value exists or not and according to that it shows the picture from that field.
Now how can I change this fuction so that it works based on another datalist item
for ex if the Gender is male the Userpic item shows :male.gif
is this possible?
Function PickColor(ByVal fldval As Double) As String
Dim color As String
If fldval < 15 Then
color = "Red"
Return color
Else
color = "green"
Return "green"
End If
End Function
<asp:DataList id="displayProfile" RepeatColumns="5" RepeatDirection="Horizontal" runat="server"
EnableViewState="False" HorizontalAlign="Center" cellSpacing="2">
<ItemTemplate>
<SPAN >
<DIV class=head> <A href="<%# DataBinder.Eval(Container.DataItem, "UserID", "profile.aspx?uid={0}") %>" >
<IMG alt="<%# DataBinder.Eval(Container.DataItem, "Firstname") %>" src="<%=strAppURL%>/user_images/<%# PickUserPic(DataBinder.Eval(Container.DataItem, "UserPic")) %>" width="<%=intWidth%>" height="<%=intHeight%>" border=0>
<BR><%# DataBinder.Eval(Container.DataItem, "firstname") %></SPAN>(<%# DataBinder.Eval(Container.DataItem, "friend_count") %>)</A></div>
</ItemTemplate>
<ItemStyle CssClass="picFrame" ></ItemStyle>
</asp:DataList>
|