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 821465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:38:40+00:00 2026-05-15T02:38:40+00:00

I am attempting to use the MapPageRoute feature in Visual Studio 2010 and .NET

  • 0

I am attempting to use the MapPageRoute feature in Visual Studio 2010 and
.NET Framework 4.0 with a asp.net webforms application.

What I have noticed is that if I define a page route called “Default” like
below and the page Default.aspx exists in the project, then the route does
not work.

routes.MapPageRoute("Default", "default.aspx", "~/Page2.aspx");
routes.MapPageRoute("Test", "test.aspx", "~/Page2.aspx");

If I change the name of the Default.aspx in the project to Default_1.aspx,
then the route works fine.

There seems to be some order of precedence going on. Is there a way to make
my route definitions evaluated first so I don’t have to rename my pages to
use the routing engine?

  • 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-15T02:38:40+00:00Added an answer on May 15, 2026 at 2:38 am

    There’s a property on the RouteCollection called RouteExistingFiles, which is set to false by default. This explains why the Default route doesn’t work if you have a default.aspx page.

    If you insert routes.RouteExistingFiles = true; before your lines of code, it would make the routes take priority. I’m not 100% sure whether it would then fall back to files if it couldn’t route – I guess it depends on the routes you have set up…

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

Sidebar

Related Questions

Attempting to use asp.net mvc's Action Result of File. So it would seem that
In attempting to use the Performance Tools on an ASP.NET website I'm getting various
I'm attempting to use the new partial page caching available in ASP.NET MVC 3.
I am attempting to use ASP.NET MVC 4 beta together with JSON.NET. I'm using
In attempting to use std::select1st from <functional> in a VS2008 project I found that
Im attempting to use Silverlight and MVC together. After creating a simple Silverlight application
I'm attempting to use the new Storyboard feature, however I am confused about Storyboard
I am attempting to use XMLParse against content that is not valid xhtml. In
I am attempting to use a VSPackage to create a Tool window for visual
I am attempting use Java Pathfinder and I have pathfinder working. import gov.nasa.jpf.jvm.Verify; user.java:2:

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.