我想知道如何根据 xml 文档中的 imageurl 将图像添加到 gridview。到目前为止我有...
XDocument xmlDoc = XDocument.Load(Server.MapPath("XMLFile.xml"));
var q = from c in xmlDoc.Descendants("Images")
where c.Element("PropertyId").Value.ToString() == DropDownList1.SelectedValue.ToString()
select new
{
Id = c.Element("PropertyId").Value,
Thumb = c.Element("ThumbUrl").Value
};
GridView1.DataSource = q;
GridView1.DataBind();
可以很好地在拇指字段中显示 url,但不是显示这个,我如何将其更改为图像字段?