Frage

I am trying to generate URL using T4MVC. Here's the view

@{
Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
        <a href="@Url.Action(MVC.Shared.Views.ShowDetails)">Click</a>
    </div>
</body>
</html>

Not sure why the link is being generated as /~/Views/Shared/ShowDetails.cshtml/

War es hilfreich?

Lösung

You should not be passing a View name to Action(). See section 2.2.2 in the doc. e.g. try something like:

<%= Url.Action(MVC.Dinners.Delete(Model.DinnerID))%>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top