0

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/

4

1 回答 1

0

您不应该将视图名称传递给 Action()。请参阅文档中的第 2.2.2 节。例如尝试类似:

<%= Url.Action(MVC.Dinners.Delete(Model.DinnerID))%>
于 2013-10-26T15:04:23.140 回答