Dear All, Obviously, I am a ASP.NET newbie :) Just wondering if I can do "if-condition" in the repeater block like I used to in ColdFusion? Just like the following: (assume I have done a query and the DataSet object named "ds" and my page language is "C#"
DataBinder.Eval(Container.DataItem, "ID")
DataBinder.Eval(Container.DataItem, "ProductName")
Product ID Must be "0"
//code a procudure something like this
void Product_ItemDataBound(Object Sender, RepeaterItemEventArgs e) {
// This event is raised for the header, the footer, separators, and items.
// Execute the following logic for Items and Alternating Items.
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
//do your decision making here
}
}
andylo
Member
100 Points
20 Posts
Can I do if-conditional in repeater?
Aug 07, 2003 05:16 AM|LINK
DataBinder.Eval(Container.DataItem, "ID") DataBinder.Eval(Container.DataItem, "ProductName") Product ID Must be "0"Thanks for you advice :)rohancragg
Member
138 Points
31 Posts
Re: Can I do if-conditional in repeater?
Aug 07, 2003 01:15 PM|LINK
//code a procudure something like this void Product_ItemDataBound(Object Sender, RepeaterItemEventArgs e) { // This event is raised for the header, the footer, separators, and items. // Execute the following logic for Items and Alternating Items. if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { //do your decision making here } }Lex Barr
Member
180 Points
36 Posts
Re: Can I do if-conditional in repeater?
Aug 07, 2003 01:38 PM|LINK
bBounce.com - Automatic email bounce handler.
TestData.com - Create meaningful test data to test your database applications.