Skip to content

Instantly share code, notes, and snippets.

Sebastiaan Janssen nul800sebastiaan

View GitHub Profile
View first-attempt.cshtml
@helper RenderCountryOptions() {
<option>Choose a country...</option>
@foreach(var region in @Model.XPath("/root/Website/CountryList/CountryList[Country[not(active = 0)]]"))
{
<optgroup label="@region.Name">
@foreach(var country in @region.Children)
{
<option>@country.Name</option>
}
</optgroup>
You can’t perform that action at this time.