newbie: ItemDataBound and XPath

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hey

asp.net 2.0

I have a DataList which has a XmlDataSource as its data source.

This code crash because I use XPath in the ItemDataBound event:
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs
e)
{
Label label = (Label)e.Item.FindControl("lblTitle");
label.Text = XPath("title").ToString();
label = (Label)e.Item.FindControl("lblStory");
label.Text = XPath("description").ToString();
}

Any suggestion how this should be done in a ItemDataBound event?

Jeff
 
Jeff said:
hey

asp.net 2.0

I have a DataList which has a XmlDataSource as its data source.

This code crash because I use XPath in the ItemDataBound event:
protected void DataList1_ItemDataBound(object sender,
DataListItemEventArgs e)
{
Label label = (Label)e.Item.FindControl("lblTitle");
label.Text = XPath("title").ToString();
label = (Label)e.Item.FindControl("lblStory");
label.Text = XPath("description").ToString();
}

Any suggestion how this should be done in a ItemDataBound event?

Jeff
 
Back
Top