Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6370901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:59:25+00:00 2026-05-25T00:59:25+00:00

I have an asp.net website with different user types like admin, registered user. Each

  • 0

I have an asp.net website with different user types like admin, registered user. Each user type has different menu options.

I have created a common master page for all types of users, but designed different sitemap files for different user types.

What I am trying to do is, after login according to the user type the sitemap should change in Master Page.

Here is the code I tried in master page loading. It is showing me error like

**The SiteMapProvider 'Principal.sitemap' cannot be found.**

I tried with and without .sitemap extension. (I have principal.sitemap and other sitemaps)

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["usertype"] == null)
        {
            Response.Redirect("loginpage.aspx");
            return;
        }

        String usertype = Session["usertype"].ToString();

        if (usertype == "Principal")
        {
            SiteMapDataSource1.SiteMapProvider = "Principal.sitemap";
        }
        else if (usertype == "Administrator")
        {

            //SiteMapDataSource1.SiteMapProvider = "Administrator";
        }
        else if (usertype == "Student")
        {
            SiteMapDataSource1.SiteMapProvider = "Student";

        }
        foo.DataBind(); 
}

Here is my Master Page aspx code part.

 <asp:SiteMapDataSource  ID="SiteMapDataSource1" ShowStartingNode="false" runat="server" />
                <ul id="cssmenu1">
                    <li><a id="A1" href="index.aspx" runat="server">Home</a></li>

                    <asp:Repeater ID="foo" DataSourceID="SiteMapDataSource1" EnableViewState="false" 
                                    runat="server" onitemcommand="foo_ItemCommand">
                        <ItemTemplate>
                            <li>
                                <a href='<%#Eval("url") %>'><%#Eval("Title") %></a>

                                <ul>
                                    <asp:Repeater ID="bar" DataSource='<%# ((SiteMapNode) Container.DataItem).ChildNodes %>' runat="server">
                                        <ItemTemplate>
                                            <li><a href='<%#Eval("url") %>'><%#Eval("Title") %></a></li>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ul>

                            </li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
            </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:59:26+00:00Added an answer on May 25, 2026 at 12:59 am

    Have you registered them in your web.config as this question demonstrates?

    How to use multiple .sitemap files in ASP.NET

    Is so, you may need to check that the name is qualified properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net website that allows the user to download largish files -
I have an ASP.NET website (in C#) that takes in user data and then
I have an ASP.NET website and over time it has become more and more
I have a ASP.NET MVC project, and I would like to have a different
I have an ASP.NET Website. I want to restrict the Admin Folder to only
I have defined a couple of different roles in my asp.net website : Administrators,
I'm working on a asp.net website and I have created a user control where
What's the best way to have two websites (asp.net based) running on different domains
I have a ASP.Net website that is failing on AJAX postbacks (both with ASP.Net
I have an ASP.NET website and when I press F5 it automatically attaches to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.