tnk479
tnk479

Reputation: 784

asp.net core won't bind the id value

I have the standard default route mapped.

app.UseMvc(config =>
        {
            config.MapRoute(
                "Default", 
                "{controller=App}/{action=Index}/{id?}"
                );
        });

In one of my controllers I have an action:

 public IActionResult EditTask(int taskId)

I used the FIrefox dev toolbar to verify that the ID value is passed correctly:

  window.location = "/Admin/EditTask/" + dataItem.TaskId;

I don't get why asp.net will not map the taskId to the action parameter.

Upvotes: 0

Views: 39

Answers (1)

Alex Sikilinda
Alex Sikilinda

Reputation: 3013

Change EditTask(int taskId) to EditTask(int id)

Upvotes: 1

Related Questions