DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("Yourxml.xml")); DropDownList1.DataSource = ds.Tables[0].DefaultView;
DropDownList1.DataTextField = "text";
DropDownList1.DataValueField = "value";
DropDownList1.DataBind();
ds.ReadXml(Server.MapPath("Yourxml.xml")); DropDownList1.DataSource = ds.Tables[0].DefaultView;
DropDownList1.DataTextField = "text";
DropDownList1.DataValueField = "value";
DropDownList1.DataBind();
<?xml-stylesheet type="text/xsl" href="ddl.xslt" ?>
<lists>
<list>
<selectItem0>please select</selectItem0>
<selectItem1>select-1</selectItem1>
<selectItem2>select-2</selectItem2>
<selectItem3>select-3</selectItem3>
</list>
</lists><?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/lists" >
<xsl:apply-templates select="list"/>
</xsl:template>
<xsl:template match="list">
<select>
<option>
<xsl:value-of select="selectItem0" />
</option>
<option>
<xsl:value-of select="selectItem1" />
</option>
<option>
<xsl:value-of select="selectItem2" />
</option>
<option>
<xsl:value-of select="selectItem3" />
</option>
</select>
</xsl:template></xsl:stylesheet>