How to make area as default route in MVC Ask Question
By   Adil Shahbaz     20-Dec-2024    1

Can any one tell me about how to make area as default route ?

 

Solutions


Adil Shahbaz

Thanks I got answer.

Here is the answer:

routes.MapRoute(
            name: "Default",
            url: "{culture}/{controller}/{action}/{id}",
            defaults: new { culture = "en", controller = "Home", action = "Index", id = UrlParameter.Optional },
            namespaces: new[] { "Demo.Areas.Admin.Controllers" }
        ).DataTokens.Add("area", "Admin");

10067
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM