MVC route doesn't work
Posted
by bill
on Stack Overflow
See other posts from Stack Overflow
or by bill
Published on 2010-05-10T16:39:59Z
Indexed on
2010/05/10
16:44 UTC
Read the original article
Hit count: 181
asp.net-mvc
|routes
Hi All,
I have a bunch of Views in a default folder that represent single "static" pages.
Everything works as advertised except i tried adding a new page yesterday.. using the exact same routing syntax and cannot for the life of me get it to work.
here's is an example of a working route:
routes.MapRoute(
"OurProgram", // Route name
"Our_Program", // URL with parameters
new { controller = "Default", action = "OurProgram" }
);
The filename is OurProgram and hitting http:// localhost/Our_Program/ opens the correct view which resides in the Views/Default folder.
So i added another view into this folder:
Views/Default/BuyNow.aspx and added the route:
routes.MapRoute(
"BuyNow", // Route name
"Buy_Now", // URL with parameters
new { controller = "Default", action = "BuyNow" }
);
And this doesn't open. I have tried the "route debugger http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx" and it correctly identifies the route.
I am at a lose. I have tried re-creating the view.. I am using MVC.Net 2.0 and VS 10.
Any help is appreciated!
© Stack Overflow or respective owner