process within repeater - Help!!

Results 1 to 2 of 2

Thread: process within repeater - Help!!

  1. #1
    Join Date
    Dec 1969

    Default process within repeater - Help!!

    This is really frustrating me. I&#039;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 &#060;ItemTemplate&#062; tag. However, i can&#039;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?!

  2. #2
    Join Date
    Dec 1969

    Default RE: process within repeater - Help!!

    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>&#060;%#DisplayType(Container.DataItem("th edataitem"))%&#062;<BR><BR>Hope that helps!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts