Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi all,

am using mvc3 razor application in my project. my problem is i have 1 main root folder under root folder 3 sub folders are there, each sub folder have 1 control. so how to set the default page under particular control.
folder names are Administrator,Customer,Merchant and my root folder is areas. now how set the default page 'Newcustomer.cshtml' in Customer folder Customercontrol. my code like this in golbal.asax page
C#
routes.MapRoute(
                "custom", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index",id = UrlParameter.Optional }// Parameter defaults

            );

but i got the error like this
~/Views/Customer/Newcustomer.aspx
~/Views/Customer/Newcustomer.ascx
~/Views/Shared/Newcustomer.aspx
~/Views/Shared/Newcustomer.ascx
~/Views/Customer/Newcustomer.cshtml
~/Views/Customer/Newcustomer.vbhtml
~/Views/Shared/Newcustomer.cshtml
~/Views/Shared/Newcustomer.vbhtml

http://localhost:2023/Customer/Customer/Newcustomer
am enter like this open my default login page


please help me..
thanks
Posted
Updated 3-Nov-12 1:36am
v3

1 solution

Hi,

"Default Route" name always points the default page in MVC3.

routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900