LINQ to XML和GridView.ImageField
|
我想知道如何基于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,但不是显示此URL,我如何将其更改为图像字段?
没有找到相关结果
已邀请:
1 个回复
死簇
后台代码:
你有什么问题?