Problem with and Routes (I guess)

Topics: Core, General, Troubleshooting
May 23, 2014 at 6:12 PM
I'm having some trouble with this website I'm working on. It's based on the Orchar Plataform, Which I had few contact with.

The problem I'm having is this:

I have 2 different modules:

1)Speak with us 2)Work with us

Both of them have different views, BUT with the same name:

1)Solicitation

So, the link to these pages would be:

1) www.example.com/Speak-with-us/Solicitation/ 2) www.example.com/Work-with-us/Solicitation/

But both links point to the Work With us module view.

Any idea why is this happenning? Thank you guys!
Developer
May 23, 2014 at 8:33 PM
It's hard to tell without seeing your code. Can you share it?
May 26, 2014 at 1:42 PM
Edited May 26, 2014 at 1:42 PM
Here's the Route.cs for the Speak With Us module:
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;


namespace Speakwithus {
    public class Routes : IRouteProvider {
        public void GetRoutes(ICollection<RouteDescriptor> routes) {
            foreach (var routeDescriptor in GetRoutes())
                routes.Add(routeDescriptor);
        }

        public IEnumerable<RouteDescriptor> GetRoutes() {
            return new[] {
                             new RouteDescriptor {   Priority = 5,
                                                     Route = new Route(
                                                         "Speakwithus/{action}",
                                                         new RouteValueDictionary {
                                                                                      {"area", "Speakwithus"},
                                                                                      {"controller", "Speakwithus"}
                                                         },
                                                         new RouteValueDictionary(),
                                                         new RouteValueDictionary {
                                                                                      {"area", "Speakwithus"}
                                                         },
                                                         new MvcRouteHandler())
                             }
                         };
        }
    }
}
And here we have the Workwithus Route.cs:
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;

namespace Workwithus  {
    public class Routes : IRouteProvider {
        public void GetRoutes(ICollection<RouteDescriptor> routes) {
            foreach (var routeDescriptor in GetRoutes())
                routes.Add(routeDescriptor);
        }

        public IEnumerable<RouteDescriptor> GetRoutes() {
            return new[] {
                             new RouteDescriptor {   Priority = 5,
                                                     Route = new Route(
                                                         "Workwithus /{action}",
                                                         new RouteValueDictionary {
                                                                                      {"area", "Workwithus "},
                                                                                      {"controller", "Workwithus "}
                                                         },
                                                         new RouteValueDictionary(),
                                                         new RouteValueDictionary {
                                                                                      {"area", "Workwithus "}
                                                         },
                                                         new MvcRouteHandler())
                             }
                         };
        }
    }
}
Developer
May 26, 2014 at 4:39 PM
This looks fine but how are you building the links?
May 26, 2014 at 6:27 PM
Where are the links built/generated?