Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to use dynamic variable Route table

$
0
0

Hi,

I want to dynamic variable inside route table.

var RoutueCategoryRootName = how can I get dynamic variable

I have Localization  in my project or I can use my sql table 

        private void ConfigureRoutes(IRouteBuilder routes)
        {
            Var RoutueCategoryRootName = "Categories";

            routes.MapRoute(
                name: "Default",
                template: "",
                defaults: new { controller = "Home", action = "Index" });

            routes.MapRoute(
                name: "Page",
                template: "{PageName}",
                defaults: new { controller = "Pages", action = "Page" });

            routes.MapRoute(
               name: "RouteCategory",
               template: RoutueCategoryRootName + "/{CategoryName}",
               defaults: new { controller = "Categories", action = "Category" });

routes.MapRoute(
name: "LanguageChange",
template: "",
defaults: new { controller = "LanguageChange", action = "SetLanguage" }); }


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>