Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 16th, 2006, 04:53 AM
Friend of Wrox
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
color = "green"
Return "green"
End If
End Function

<asp:DataList id="displayProfile" RepeatColumns="5" RepeatDirection="Horizontal" runat="server"
EnableViewState="False" HorizontalAlign="Center" cellSpacing="2">


  <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>

      <ItemStyle CssClass="picFrame" ></ItemStyle>

Similar Threads
Thread Thread Starter Forum Replies Last Post
Datalist inside datalist amit.jagtap ASP.NET 2.0 Professional 1 September 4th, 2007 05:03 AM
send variable in function to another function schoolBoy Javascript How-To 6 March 3rd, 2007 09:16 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
retreive function/Line from macro or function? MikoMax J2EE 0 April 1st, 2004 04:42 AM
DataList Search function Ajay ASP.NET 1.x and 2.0 Application Design 1 June 12th, 2003 02:14 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.