I am using SharePoint designer to build a page with a data view web part that displays the contents of a 6,000 record XML file that is structured like the example below with each "Details" element being a record.

<?xml version="1.0" encoding="UTF-8"?>
      <Display_Name>Weather, Wendy</Display_Name>
      <Email>[email protected]</Email>
      <Site_Location>Denver, CO</Site_Location>

I want to filter that DVWP by the Site_Location element using an ASP dropdown control. Rather than have to maintain a list of about a hundred Site Locations as choices in the dropdown control's code, I want to simply use that XML file as the data source for my dropdown's choices.

I can insert the XML data source onto the page just fine. But, when I select it as the data source for my dropdown and then preview the page, it gives me a web part error and the page won't load.

I assume that what I am doing is possible. Is it not working because my XML file doesn't have any schema information? It seems to be well-formed enough to load in the DVWP. After-all, the entire page works great UNTIL I associate the ASP dropdown with the data source. That's when it breaks.

1 Answer 1


I think you need sth. like this in your code:

<asp:DropDownList runat="server" id="siteLocationList{$Pos}" OnSelectedIndexChanged="javascript:openViewForSite();">
    <xsl:variable name="siteLocation" select="@answer"/>
    <xsl:for-each select="/Details_Collection/Details">
        <xsl:sort select="Site_Location"/>
            <xsl:value-of select="Site_Location"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.