0
votes

when i use *catchall in my program , my routing isnt true.

public void Configure(IApplicationBuilder app, IHostingEnvironment env) {

        app.UseMvc(routes =>
        {
            routes.MapRoute(
            name: "AdminArea",
            template: "{area:exists}/{controller=home}/{action=index}/{id?}");

            routes.MapRoute(
                name: "SimplifyAsdreaAdmin",
                template: "{controller=home}/{action=index}/{id:int?}/*Catchall");

        });
    }

when i delete *catchall in the second route ,the routing It runs correctly. but when put *catchall when i need to going to area (ex:admin) give me this url: https://localhost:44339/home/temping?area=Admin

somebody know why this occur happen?

1

1 Answers

0
votes

You need to wrap it in curly braces like the other route parameters .../{*catcahall}