【发布时间】:2016-01-23 22:39:42
【问题描述】:
我的应用程序 ASP.NET MVC 5 我正在使用 Syncfusion 控件。
这是我的看法:
@using Reporter.Models
@model List<UsersListViewModel>
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource(Model)
.AllowFiltering()
.FilterSettings(d => d.FilterType(FilterType.Menu))
.AllowSorting()
.ToolbarSettings(toolBar => toolBar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.ExcelExport);
}))
.Columns(col =>
{
col.Field("OrderNumber").HeaderText("Lp.").TextAlign(TextAlign.Left).Width(15).AllowFiltering(false).Add();
col.Field("UserName").HeaderText("Nazwa użytkownika").Width(50).Add();
col.Field("CanReadReports").HeaderText("Dostęp do raportów").Width(40).AllowSorting(false).HeaderTextAlign(TextAlign.Center).Add();
col.Field("IsAdministrator").HeaderText("Administrator").Width(40).AllowSorting(false).Add();
})
.Mappers(map => map.ExportToExcelAction("Account/UserListExportToExcel"))
.AllowSelection()
.SelectionType(SelectionType.Single)
)
<hr/>
<p style="text-align: justify">
@Html.ActionLink("Nowy użytkownik", "Register", "Account",
null,
new { @class = "btn btn-default" }
)
@Html.ActionLink("Usuń użytkownika", "Register", "Account",
new {user = "UserNameToRaplace"}, //here i want UserName from selected row
new { @class = "btn btn-default" }
)
@Html.ActionLink("Zmień hasło", "Manage", "Account",
new { user = "UserNameToRaplace"},
new { @class = "btn btn-default" }
)
</p>
我的问题是如何从选定的行中获取用户名并将其粘贴到 ActionLink 中。
【问题讨论】:
标签: javascript asp.net-mvc syncfusion