<Advertisements>
- <Ad>
<ImageUrl>img/1.jpg</ImageUrl>
<NavigateUrl>default3.aspx</NavigateUrl>
<AlternateText>denglu</AlternateText>
<Keyword />
<Impressions>80</Impressions>
</Ad>
</Advertisements>
void fill()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("~/xml.xml"));
if (ds.Tables.Count == 0)
{
DataList1.Visible = false;
Panel1.Visible = true;
}
else
{
DataList1.DataSource = ds.Tables[0].DefaultView;
DataList1.DataBind();
Session["ds"] = ds;
}
}
protected void DataList1_EditCommand(object source, DataListCommandEventArgs e)
{
DataList1.EditItemIndex = e.Item.ItemIndex;
fill();
}
protected void DataList1_CancelCommand(object source, DataListCommandEventArgs e)
{
DataList1.EditItemIndex = -1;
fill();
}
本人不太懂这些!!帮忙解释解释分析分析。谢谢