treyzujdikeipgeln
New Member
This is really frustrating me. I'm using the Repeater control to write out several lines of db records. However, for one of the fields, if a numeric 1 is returned, i want to display "Windows" for that field, and if a numeric 2 is returned, i want to display "Mac".<BR><BR>So this If Else action has to take place inside the <ItemTemplate> tag. However, i can't find any way to run VB code or do an evaluation inside the ItemTemplate portion of the Repeater. How can i do an If Else for each record as it loops through the Repeater?!Make a function..<BR><BR> Public Function DisplayType(ByVal yourvar) <BR> If yourvar=1 Then <BR> DisplayType="Windows" <BR> Elseif yourvar=2<BR> DisplayType="Mac"<BR> Else<BR> DisplayType="" <BR> End If <BR> End Function <BR><BR>you put that function in the code behind page, then in your repeater item template you would put... <BR><BR><%#DisplayType(Container.DataItem("thedataitem"))%><BR><BR>Hope that helps!