C# Html ActionLink未显示
我正在显示一个小表,其中有一个用户名列表,我希望每个用户名旁边都有一个ActionLink,以便在另一个页面上编辑该用户 这是我的查看页面:C# Html ActionLink未显示,c#,asp.net,asp.net-mvc,C#,Asp.net,Asp.net Mvc,我正在显示一个小表,其中有一个用户名列表,我希望每个用户名旁边都有一个ActionLink,以便在另一个页面上编辑该用户 这是我的查看页面: <%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<WebUI.Models.IndexModel>>" %> <table> <tr> <th>&
<%@ Page Title="" Language="C#"
Inherits="System.Web.Mvc.ViewPage<IEnumerable<WebUI.Models.IndexModel>>" %>
<table>
<tr>
<th></th>
<th>Username</th>
</tr>
<% foreach (var item in Model) { %>
<tr>
<td><% Html.ActionLink("Edit", "Edit", "Employee", new { id = item.UserID }, null); %></td>
<td><%: item.Username %></td>
</tr>
<% } %>
</table>
用户名显示正确,只是链接不显示。我不知道为什么它不会抛出一个错误
我在这里遗漏了什么?试着移除;并加入:在—
试着把它移走;并加入:在—
您的代码中缺少:。 试试这个:
<td><%: Html.ActionLink("Edit", "Edit", "Employee", new { id = item.UserID }, null) %></td>
编辑:删除该文件;最后,您之前没有注意到它。您的代码中缺少一个:。 试试这个:
<td><%: Html.ActionLink("Edit", "Edit", "Employee", new { id = item.UserID }, null) %></td>
编辑:删除该文件;最后我没注意到
<%:Html.ActionLink("Edit", "Edit", "Employee", new { id = item.UserID }, null) %>
<td><%: Html.ActionLink("Edit", "Edit", "Employee", new { id = item.UserID }, null) %></td>