---
title: "Issue in MVC routing"  
description: "Issue in MVC routing"  
author: "Anonymous User"  
published: 2014-10-30  
updated: 2014-10-30  
canonical: https://www.mindstick.com/forum/2464/issue-in-mvc-routing  
category: "asp.net mvc"  
tags: ["asp.net mvc", "mvc4"]  
reading_time: 1 minute  

---

# Issue in MVC routing

I have a [page](https://www.mindstick.com/articles/13031/why-to-make-a-wikipedia-page) that I want it to have 2 different routes: "/[Admin](https://www.mindstick.com/articles/12934/3-functionalities-that-a-magento-admin-mobile-app-can-empower-you-with)/[Schedules](https://answers.mindstick.com/qa/37886/how-many-schedules-are-there-in-constitution-of-india)" AND "/Schedules"

"/Admin/Schedules" if for admin [users](https://www.mindstick.com/news/2244/issue-preventing-users-from-accessing-facebook-s-social-networking-platforms-has-been-resolved) and the page will [render](https://www.mindstick.com/interview/2205/why-we-need-a-separate-mobile-project-template-while-we-can-render-our-web-application-in-mobile-what-s-new-in-mvc-4-mobile-template) some admin [features](https://www.mindstick.com/articles/12993/5-advanced-features-for-your-odoo-ecommerce-theme) and it needs to [log](https://www.mindstick.com/articles/126269/the-main-uses-of-log-cabins) in... on the other hand, "/Schedules" is for non-logged users and it will render non-admin features...

But, the page is the same and I specifically need these two routes.

## Replies

### Reply by Anonymous User

you could accomplish this in the controller as ajma said by just having an if condition and a switch statement in a method that checks if the user exist like so:

```
if(UserID !=null){    switch(UserPreference)   {       case 1:                   action = "Schedules";                    top = TypeOfPage.Admin;                   view = "Schedules";                   break;        default:                   action = "Schedules";                    top = TypeOfPage.Nonuser;                   view = "Schedules";                   break;    }}
```


---

Original Source: https://www.mindstick.com/forum/2464/issue-in-mvc-routing

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
