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

  • Home
  • SEARCH
  • 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 6117307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:18:20+00:00 2026-05-23T15:18:20+00:00

I’ve got my web forms site (4.0) setup with UrlRouting. My bread crumb appears

  • 0

I’ve got my web forms site (4.0) setup with UrlRouting.
My bread crumb appears when I go to

  • http://Localhost/Home
  • http://Localhost/List

My main issue is with http://Localhost/

Since it’s defaulting to http://Localhost/default.aspx in IIS

I’m trying to avoid the route of adding another element to the sitemap xml like

<siteMapNode url="~/Home" title="Home"  description="Home" aspx="default.aspx">

What would be the best approach to use?

I’ve tried to add this to my routing table & using an xmlSiteMapProvider to see if I could so something with it (which didn’t work).

routes.MapPageRoute("IISDefault", "", "~/Default.aspx");

Here’s some of info.

Routes
routes.MapPageRoute("Default", "Home", "~/Default.aspx");
routes.MapPageRoute("ListAll", "List", "~/ListAll.aspx");

Sitemap
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/Home" title="Home"  description="Home">
        <siteMapNode url="~/List" title="List All"  description="List All"  />
    </siteMapNode>
</siteMap>

XmlSiteMapProvider

   /// <summary>
    /// This is where the original sitemap node is overloaded.  We get the proper translation from the database.
    /// </summary>
    /// <param name="sender">This is the sender of the event</param>
    /// <param name="e">This is the event arguments</param>
    /// <returns>Returns a modified SiteMapNode</returns>
    /// <remarks></remarks>
    public SiteMapNode SmartSiteMapProvider_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
    {

        SiteMapNode returnValue = null;

        if ((SiteMap.CurrentNode == null))
        {
            // If we don't find a sitemap node, then we might be working with UrlRouting
            returnValue = ProcessRoute(e);
        }


        return returnValue;

    }

    private SiteMapNode ProcessRoute(SiteMapResolveEventArgs e)
    {

        SiteMapNode returnValue = null;

        System.Web.Routing.RequestContext rc = HttpContext.Current.Request.RequestContext;

        if ((rc != null))
        {
            System.Web.Routing.RouteBase route = rc.RouteData.Route;

            if ((route != null))
            {
              // Play with the node (Never getting here)
            }
        }

        return returnValue;

    }

Edit: I’m going to see if I can manipulate the routeCollection to get a match somehow.

  • 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-23T15:18:21+00:00Added an answer on May 23, 2026 at 3:18 pm

    Instead of :

    Routes
    routes.MapPageRoute("Default", "Home", "~/Default.aspx");
    routes.MapPageRoute("ListAll", "List", "~/ListAll.aspx");
    
    Sitemap
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
        <siteMapNode url="~/Home" title="Home"  description="Home">
            <siteMapNode url="~/List" title="List All"  description="List All"  />
        </siteMapNode>
    </siteMap>
    

    try this:

    Routes
    routes.MapPageRoute("Default", "Home", "~/");
    routes.MapPageRoute("ListAll", "List", "~/ListAll.aspx");
    
    Sitemap
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
        <siteMapNode url="~/" title="Home"  description="Home">
            <siteMapNode url="~/List" title="List All"  description="List All"  />
        </siteMapNode>
    </siteMap>
    

    Otherwise “~/” and “~/Home” are the same thing.

    or you could leave the above as is and in the default.aspx page do something like this …

    if(Page.RouteData.Values[0] == "default.aspx")
        Response.Redirect("~/Home")
    

    That would effectively redirect any default request to your default request.

    Your problem is that the server sees ~/” and “~/Home” as being 2 different urls and you basically want them to be the same, so you have to make a decision and decide which one to redirect to the other.

    personally if this was my solution I would’nt have a route for “~/Home” and my base node in my sitemap would look something like this:

    <siteMapNode url="~/" title="Home"  description="Home">
    

    It’s clean and obvious that “http://yourdomain/” is the homepage and “http://yourdomain/Home” could be anything (about your home, my home, home sweet home, things i like in my home) whereas “http://adomain/” is the homepage across the globe for everyone.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.