Syntax to specify Namespace when using helper.RouteUrl

Posted by B Z on Stack Overflow See other posts from Stack Overflow or by B Z
Published on 2010-03-24T23:38:17Z Indexed on 2010/03/24 23:43 UTC
Read the original article Hit count: 288

Filed under:

I am using Asp.Net MVC 2 - RC w/ Areas.

I am receiving an ambigious controller name exception due to having same controller name in two different areas.

I've read Phil Haack's post

I can't figure out the syntax when trying to use UrlHelper (I have an extensions class).

e.g.

public static string MyAreaHome(this UrlHelper helper) {
            return helper.RouteUrl("ARoute", new { controller = "Home", action = "Index" });
    }

I've tried the obvious of adding namespace="mynamespace" but that didn't work, it just added the namespace to the url. Thanks for any help.

© Stack Overflow or respective owner

Related posts about asp.net-mvc