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.
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!!!
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: