Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

How to use Areas in Asp.net core 1.0 Rc2 ?? #4775

Closed
ermithun opened this issue May 30, 2016 · 5 comments
Closed

How to use Areas in Asp.net core 1.0 Rc2 ?? #4775

ermithun opened this issue May 30, 2016 · 5 comments

Comments

@ermithun
Copy link

No description provided.

@davidfowl
Copy link
Member

@ermithun
Copy link
Author

ermithun commented May 30, 2016

Gone through above blog but not yet found any solution
i am trying this in Asp.net core 1.0 rc2
<form asp-action="Register" asp-controller="Account" asp-route-area="Global">
which gives
<form method="post" action="/Account/Register?area=Global">
but i want
<form method="post" action="/Global/Account/Register">

@ermithun
Copy link
Author

Solved issued
my routing was
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(name: "areaRoute",
template: "{area:exists}/{controller=Home}/{action=Index}");
});
# solution is reverse
app.UseMvc(routes =>
{

            routes.MapRoute(name: "areaRoute",
                    template: "{area:exists}/{controller=Home}/{action=Index}");

            routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
        });

@ermithun ermithun closed this as completed Jun 1, 2016
@javiercn
Copy link
Member

javiercn commented Jun 1, 2016

aspnet/Announcements#120

@vsg24
Copy link

vsg24 commented Jul 24, 2016

https://stackoverflow.com/questions/36535511/how-to-use-area-for-asp-net-core

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants