pb102674
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="F alse" 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.InitializeSiteM ap(User.Id entity.Nam e, Me.Context)
End Sub
Public Shared Sub InitializeSiteMap(ByVal username As String, ByVal context As HttpContext)
Dim smp As SOC2005.ccSiteMapProviderL DAP = New SOC2005.ccSiteMapProviderL DAP()
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
<asp:SiteMapDataSource ID="smds" runat="server" />
<asp:TreeView ID="trvNavigation" runat="server" NodeIndent="5" NodeWrap="True" PopulateNodesFromClient="F
<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.InitializeSiteM
End Sub
Public Shared Sub InitializeSiteMap(ByVal username As String, ByVal context As HttpContext)
Dim smp As SOC2005.ccSiteMapProviderL
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
'trvNavigation.DataBind()
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.