gpt4 book ai didi

c# - 如何使用asp.net在下拉列表中绑定(bind)图像和名称

转载 作者:太空宇宙 更新时间:2023-11-03 13:37:37 26 4
gpt4 key购买 nike

<分区>

我正在使用这段代码来绑定(bind)下拉列表。

 protected void BindDataToGridviewDropdownlist()
{
XmlTextReader xmlreader = new XmlTextReader(Server.MapPath("XMLFILE.xml"));
DataSet ds = new DataSet();
ds.ReadXml(xmlreader);
xmlreader.Close();


if (ds.Tables.Count != 0)
{
ddlDetails.DataSource = ds;

ddlDetails.DataTextField = "name";
ddlDetails.DataValueField = "name";
ddlDetails.DataBind();


}

}

它的工作,但我也在下拉列表中绑定(bind)图像。

数据来自xml文件,这里是xml文件的节点。

<ente>
<name>Sydney</name>
<img>abc_australia.png</img>
<descri>ABC Radio Box 9994 GPO Sydney NSW 2001</descri>
<nazione>AUSTRALIA - AUSTRALIA</nazione>
<latitudine>-33.870652</latitudine>
<longitudine>151.208895</longitudine>
<zoom>-3</zoom>
</ente>

我如何在这里绑定(bind)图像。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com