---
# System prepended metadata

title: mvc controller area裡 衝突問題
tags: [c#, mvc, 火箭]

---

# mvc controller area裡 衝突問題
###### tags: `火箭` `c#` `mvc`

在\WebApplication1\App_Start\RouteConfig.cs
裡 加
專案名.contrellers
```csharp=
,new string[] { "WebApplication1.Controllers" }
```


```csharp=
 public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },new string[] { "WebApplication1.Controllers" }
            );
        }
```

```csharp=
public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "Sample.Controllers" }
            );
        }
```