xmldocument, dropdownlist.
Jeg har en metode:internal static XmlDocument getRealmList(Regions region)
Og så har jeg en server control, med:
private DropDownList _regions;
private DropDownList _realm;
protected override void CreateChildControls()
{
//Regions, US/EU
_regions = new DropDownList();
_regions.Items.Add(new ListItem("EU",Regions.EU.ToString()));
_regions.Items.Add(new ListItem("US", Regions.US.ToString()));
Controls.Add(_regions);
}
Jeg har da sidded og rodet lidt rundt i det uden held. Men vil gerne have så _realm dropdownlisten bliver populated med <Realm name"bbbbbb" ....>
name stringen.
Et lille udsnit af det Xml der er i XmlDocument fra den først nævnte metode:
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="/layout/battlegroups.xsl"?><page globalSearch="1" lang="en_gb" requestUrl="/battlegroups.xml">
<battlegroups>
<battlegroup display="Blackout" name="blackout" sortPosition="1">
<realms>
<realm name="Sunstrider" nameEN="Sunstrider"/>
<realm name="Doomhammer" nameEN="Doomhammer"/>
<realm name="Twilight's Hammer" nameEN="Twilight's Hammer"/>
<realm name="Emerald Dream" nameEN="Emerald Dream"/>
<realm name="Bloodscalp" nameEN="Bloodscalp"/>
<realm name="Burning Blade" nameEN="Burning Blade"/>
<realm name="Aggramar" nameEN="Aggramar"/>
<realm name="Arathor" nameEN="Arathor"/>
<realm name="Aszune" nameEN="Aszune"/>
<realm name="Azjol-Nerub" nameEN="Azjol-Nerub"/>
<realm name="Draenor" nameEN="Draenor"/>
<realm name="Zenedar" nameEN="Zenedar"/>
<realm name="Agamaggan" nameEN="Agamaggan"/>
<realm name="Bladefist" nameEN="Bladefist"/>
<realm name="Dragonblight" nameEN="Dragonblight"/>
<realm name="Al'Akir" nameEN="Al'Akir"/>
<realm name="Bloodhoof" nameEN="Bloodhoof"/>
<realm name="Warsong" nameEN="Warsong"/>
</realms>
</battlegroup>
<battlegroup display="Cataclysme" name="cataclysm" sortPosition="2">
<realms>
<realm name="Cho'gall" nameEN="Cho'gall"/>
<realm name="Sargeras" nameEN="Sargeras"/>
<realm name="Kirin Tor" nameEN="Kirin Tor"/>
<realm name="Sinstralis" nameEN="Sinstralis"/>
<realm name="Ner'zhul" nameEN="Ner'zhul"/>
<realm name="Hyjal" nameEN="Hyjal"/>
<realm name="Dalaran" nameEN="Dalaran"/>
<realm name="Archimonde" nameEN="Archimonde"/>
<realm name="Elune" nameEN="Elune"/>
<realm name="Kael'thas" nameEN="Kael'thas"/>
<realm name="Illidan" nameEN="Illidan"/>
</realms>
</battlegroup>