Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP.NET (Non-Forum Related)
 Repeater problem...
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

alextam
Starting Member

Hong Kong
42 Posts

Posted - 25 October 2003 :  23:03:23  Show Profile  Visit alextam's Homepage  Send alextam an ICQ Message
Hi, i have a problem when using Repeater control.

In the templates, i would like to show selected records only. For example i use SQL to select ALL records from database and i only want to show those records with "show" column is "true". Then how can i refer to the "show" column in the repeater templates? I have tried to use <%# if Container.DataItem("show") = "true" then %> but it fails.

Please help~

Thanks,
Alex

Thanks a lot!
Regards.

Nathan
Help Moderator

USA
7664 Posts

Posted - 01 November 2003 :  17:36:00  Show Profile  Visit Nathan's Homepage
You need to loop through the "records" in your DataTable and weed out the ones you dont want to show.

Alternatly, I *think* you can set the 'visibility' of the 'repeateritom' to false based on the conditional statement you posted above. Goodness, I'm already getting rusty, I really need to so some ASP.NET coding!!!

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 01 November 2003 :  19:24:11  Show Profile  Visit D3mon's Homepage
Is Container.DataItem("show") a boolean item or string? Currently you are reffering to it as a string "true" which is different to a boolean true. Try this:

<%# if Container.DataItem("show") = true then %>


or

<%# if Container.DataItem("show") then %>


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Edited by - D3mon on 01 November 2003 19:25:28
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07