namespace projeadi.Areas.Admin
{
public class AdminAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Admin";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
name: "Admin_Login",
url: "Admin",
defaults: new { controller = "Login", action = "Index" }
);
context.MapRoute(
name: "Admin_default",
url: "Admin/{controller}/{action}/{id}",
defaults: new { action = "Index", id = UrlParameter.Optional }
);
}
}
}
//controller
public class LoginController : Controller
{
//GET: Admin/Login
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Index(User u)
{
//Kodlar....
return View();
}
}
Normalde Görünecek URL:
www.domain.com/Admin/Index
Düzenlemeden Sonra Görünecek URL:
www.domain.com/Admin