asp.net MapPageRoute order of precedence

M

moke

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

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top