Question

I'm using VS2010 and ASP.NET MVC 4 for my project. I need a controller that should get 2 parameters.

this is my controller method:

[AcceptVerbs(HttpVerbs.Get)]
public ActionResult AcceptBid(int? Id, int? Accept)
{
    if (Id != null && Accept != null)
    {
          //my code...
    }
}

and I created action link like this:

@Html.ActionLink("Accept", "AccpetBid", "Project", new { area = "Service", Id = item.ProjectId, Accept = item.Id }, null)

When I clicked on this link, controller not working and this error thrown:

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Note that other controller methods in this controller class are working.

Was it helpful?

Solution

The action name is 'AcceptBid' but your link are trying to access 'AccpetBid'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top