DataList supports the ItemDataBound event, which is where you would do this
kind of "stuff":
void Item_Bound(Object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
// Retrieve the Label control in the current DataListItem.
Label PriceLabel = (Label)e.Item.FindControl("PriceLabel");
// modify the label, hyperlink, etc. here
-- Peter
Site:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
MetaFinder:
http://www.blogmetafinder.com
"David C" wrote:
> I have a DataList control that displays file names from a directory. I
> would like to conditionally add a string to the DataNavigateUrlFormatString
> in a HyperlInk column before it is displayed. Where is the best place to do
> that? Currently the DataNavigateUrlFormatString="ShowDocs.aspx?doc={0}" and
> I want to sometimes add a 2nd querystring value. Thanks.
>
> David
>
>
>