Answer the question
In order to leave comments, you need to log in
How to configure routers in two applications?
Created several projects, one admin panel, the other just an application.
When I run the solution, only the admin route is processed
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace IQS
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Admin",
url: "Admin/{controller}/{action}/{id}",
defaults: new { controller = "Service", action = "Index", id = UrlParameter.Optional }
);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Widget
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "Widget/{controller}/{action}/{id}",
defaults: new { controller = "Service", action = "Index", id = UrlParameter.Optional }
);
}
}
}
Answer the question
In order to leave comments, you need to log in
Why have separate projects been created?
Use one project, and in it already create areas (Areas) for the admin panel and the application itself.
You can read about it here
metanit.com/sharp/mvc5/6.5.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question