Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MVC3
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
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 3-Nov-12 0:30am
Edited 3-Nov-12 1:36am
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
);
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 355
1 Maciej Los 180
2 Richard MacCutchan 115
3 arvind mepani 104
4 Tino Fourie 92


Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 29 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid