fizzled
Regular
I am working on a small forum project for the sake of learning. At the moment, I'm using a Repeater to list Forums, and a custom control named ForumLink to actually create a link to each forum. Within ForumLink is simply a LinkButton with some additional formatting. Within the Repeater's OnItemDataBound method I am trying to pass the current DataItem as a DataRowView to a public property of ForumLink, ForumDataRowView, so that I can customize the display of the LinkButton. To set properties of standard controls, I'd simply use the FindControl() method, but I'm having trouble casting to my custom control.
Anyone know where I'm going wrong?
Code:
/* Produces the error: CS0246: The type or namespace name
'ForumLink' could not be found (are you missing a using
directive or an assembly reference?) */
((ForumLink) e.Item.FindControl("lnkForum")).ForumDataRowView =
(DataRowView) e.Item.DataItem;
Anyone know where I'm going wrong?