Link to home
Start Free TrialLog in
Avatar of pb102674
pb102674Flag for United States of America

asked on

"The file web.sitemap required by XmlSiteMapProvider does not exist." error in ASP.Net

Hi experts – Need help with this error. Its running fine in my localhost, but after IIS deployment I’m getting the error. The environment is VS2005, VB.Net and SQL Server 2005. The default.aspx page uses a master page that has the following in the markup

<asp:SiteMapDataSource ID="smds" runat="server" />
<asp:TreeView ID="trvNavigation" runat="server" NodeIndent="5" NodeWrap="True" PopulateNodesFromClient="False" ShowLines="True">
<RootNodeStyle ForeColor="#000000" Font-Size="16px" Font-Bold="true" />
     <HoverNodeStyle CssClass="NavTreeNodeHover"  />
     <NodeStyle CssClass="NavTreeNode" />
</asp:TreeView>

The sitemap is Initialized as follows during Session_OnStart:
 
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        ' Code that runs when a new session is started
        SharedCode.InitializeSiteMap(User.Identity.Name, Me.Context)
End Sub
 
Public Shared Sub InitializeSiteMap(ByVal username As String, ByVal context As HttpContext)
        Dim smp As SOC2005.ccSiteMapProviderLDAP = New SOC2005.ccSiteMapProviderLDAP()

        smp.BuildSiteMap(username)
        context.Session("smp") = smp
End Sub

‘This is the code for the Init event of Master page
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        smds.Provider = CType(Session("smp"), SiteMapProvider)
        trvNavigation.DataSourceID = "smds"
        'trvNavigation.DataBind()
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Melih SARICA
Melih SARICA
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial