---
title: "How can I set a route for a controller without a default action in MVC 5?"  
description: "How can I set a route for a controller without a default action in MVC 5?"  
author: "Anonymous User"  
published: 2013-09-28  
updated: 2013-09-28  
canonical: https://www.mindstick.com/forum/1549/how-can-i-set-a-route-for-a-controller-without-a-default-action-in-mvc-5  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 1 minute  

---

# How can I set a route for a controller without a default action in MVC 5?

I have the following:\

```
routes.MapRoute(
    "Account",
     url: "{controller}/{action}/{id}",
     defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
    );
```

However I don't want to specify a [default](https://www.mindstick.com/interview/12771/what-is-the-importance-of-default-resources) [action](https://www.mindstick.com/forum/155752/what-is-action-result-with-its-types). Is there a way to do this for my MVC5 [application](https://www.mindstick.com/articles/12824/calculator-application-in-android)?

## Replies

### Reply by Anonymous User

Hey Ashish! You can try the below code.

```
routes.MapRoute(
    "Account",
     url: "Account/{action}/{id}",
     defaults: new { controller = "Account", id = UrlParameter.Optional }
    );
```


---

Original Source: https://www.mindstick.com/forum/1549/how-can-i-set-a-route-for-a-controller-without-a-default-action-in-mvc-5

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
