Treeview control and TreeNodeXslSrc error

Last post 10-06-2009 9:49 AM by sakellariadis. 0 replies.

Sort Posts:

  • Treeview control and TreeNodeXslSrc error

    10-06-2009, 9:49 AM

     I have a treeview control that works fine until I modify web.config to protect static files. Then I get the following error:

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    The XML loaded from TreeNodeSrc=XMLFile1.xml, TreeNodeXslSrc= did not contain the required outer <TREENODES> container.

    Hoping someone can help.

    To reproduce, I can use the following TreeView.ASPX file (from http://www.15seconds.com/issue/030827.htm):

    <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
    <%@ Page Language="vb" %>
    <HTML>
      <HEAD>
         <title>XMLIn</title>
      </HEAD>
         <body>
             <form id="Form1" method="post" runat="server">
             <iewc:TreeView id="TreeView1" runat="server" TreeNodeSrc="XMLFile1.xml"></iewc:TreeView>
             </form>
         </body>
    </HTML>

    with the following XMLFile1.XML file:

     <TREENODES>
        <treenode text="Parent1">
        <treenode text="Child-1a"/>
        <treenode text="Child-1b"/>
    </treenode>
       <treenode text="Parent2">
       <treenode text="Child-2a"/>
       <treenode text="Child-2b"/>
       </treenode>
    </TREENODES>

    This works fine, with standard web.config file. However, I want to change the site to protect static files, so I add the following into web.config as the first lines within the <system.webServer> tag:

         <modules>
           <remove name="FormsAuthenticationModule" />
           <add name="FormsAuthenticationModule" type="System.Web.Security.FormsAuthenticationModule" />
           <remove name="UrlAuthorization" />
           <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
           <remove name="DefaultAuthentication" />
           <add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" /> 
         </modules>

    (For an explanation see http://learn.iis.net/page.aspx/244/how-to-take-advantage-of-the-iis7-integrated-pipeline/) This new web.config file works exactly to protect static files throughout the website, but causes the treeview control to fail. Can anyone suggest a workaround or know the cause?

     

    Thanks!

    Spyros

     

Page 1 of 1 (1 items)