0

i'm confused of making route need help!. i put the code (below) in route config but i didn't know why Image action not perform to what i expect.

         routes.MapRoute(
            name: "Browse",
            url: "{action}/{*path}",
            defaults: new { controller = "Sample", action = "browse"},
            constraints: new { action = "Browse|Image" }
        );

when i put to window.location.href = 'localhost:11934/browse/a' it works, but when i change browse 'localhost:11934/image/a' to image in does not.

what was the problem with that? someone give me some link on how to used constraints

1 Answer 1

1

please refer this like
http://www.asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs
http://www.itorian.com/2013/10/route-constraints-in-mvc.html
How do I use constraints in ASP.net MVC 4 RouteConfig.cs?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.