areas in asp.net mvc?
I have a Home page route in the root area:
routes.MapLocalizedRoute("HomePage",
"",
new { controller = "Home", action = "Index" },
new[] { "Nop.Web.Controllers" });
and an area called Xahoi
namespace Nop.Web.Areas.Xahoi
{
public class XahoiAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Xahoi";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Xahoi_default",
"Xahoi/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional },
new[] { "Nop.Web.Areas.Xahoi.Controllers" });
}
}
}
when i call http://domain.com/xahoi/home -> it does get into Home
controller in Xahoi Area but then it runs the Index view from Home
controller in the root.
Also, suppose i want to change the call to just http://domain.com/xa-hoi ,
how can i do that ?
No comments:
Post a Comment