Forums

ASP

This topic is locked

Same value for repeated Items :(

Posted 23 Apr 2007 12:01:42
1
has voted
23 Apr 2007 12:01:42 steven Macquoy posted:
Some say that an if statemet may not be used within the repeater control.
You chould use the if statement only within a funtion.


Seems that everything works fine, but the value for all the members in my repeater is always the same.

if i could use "DSMember.FieldValue("gebDatum", Container)" in my StrGelijk in stead of "DSMember.FieldValue("gebDatum"" then i think my problem is fixed.
But when i use the code like that it says the the name container is not declaired!

Someone an idea what i can do?

---------------------------------------------------------------------------------------------------------------------------------
Function CheckBday(GebDate As object) as String
Dim StrGelijk as String
Dim StrOnGelijk as String

StrGelijk = "<strong> " & DSMember.FieldValue("gebDatum" & " " & DSMember.FieldValue("Achternaam" & " " & DSMember.FieldValue("Voornaam" &"</strong>"

StrOnGelijk = DSMember.FieldValue("gebDatum" & " " & DSMember.FieldValue("Achternaam" & " " & DSMember.FieldValue("Voornaam"

If day(GebDate) = day(Today)
return StrGelijk
Else
return StrOnGelijk
End IF

End Function

<ASP:Repeater ID="SameDate" runat="server" DataSource='<%# DSMember.DefaultView %>'>
<ItemTemplate>
<%# CheckBday(DateTime.Parse(DSMember.FieldValue("gebDatum", Container))) %>
</ItemTemplate>
</ASP:Repeater>

------------------------------------------------------------------------------------------------------------------------------------------------------------

output:

17/04/1982 0:00:00 dierckx dorien
17/04/1982 0:00:00 dierckx dorien
17/04/1982 0:00:00 dierckx dorien
17/04/1982 0:00:00 dierckx dorien


He knows that the last user has it's birhday today (20/4/07), that's the part thats wright!
But de last user names "jef" instead of dorien??????

Thanks!

Reply to this topic