blipman17
blipman17

Reputation: 531

mvc3 not accepting proper URL?

I've got a controller named "TafelController.cs" and a view named "Berekenen.cshtml". (the names aren't made up by me.)

the url "http://localhost:5181/tafel/berekenen" somehow doesn't work, even when adding extensions to berekenen like ".cshtml". Decapitalizing the names of the controller and the view also doesn't work. The thing is, I get the proper view when I make the Index() method the following.

public ActionResult Index()
{
    return View("berekenen");
}

which is weird, because that's what

http://localhost:portnum/tafel/berekenen

is. when setting that page as the startpage the URL differs a bit. Then it becomes

http://localhost:5181/Views/tafel/berekenen.cshtml

Does anyone have any idea what might be happening?

Upvotes: 0

Views: 40

Answers (1)

user3559349
user3559349

Reputation:

http://localhost:portnum/tafel/berekenen is trying to navigate to a method named Berekenen on TafelController. You need to add the following method

public ActionResult Berekenen()
{
    return View();
}

Upvotes: 2

Related Questions