添加 htmlAttributes 后 Ajax.ActionLink() 不会触发
我需要从集合中构建超链接(ActionLink)列表。在以下代码中应用 htmlAttribute 后,ActionLink 不会触发回服务器。
@foreach (MillitarySlot slot in item.MondaySlots)
{
@Ajax.ActionLink(linkText: @slot.SlotText,
actionName: "CreateIndex",
routeValues: new { someId = slot.Id },
ajaxOptions: new AjaxOptions
{
UpdateTargetId = "divCreateSchedule",
InsertionMode = InsertionMode.Replace,
HttpMethod = "post"
},
//After adding following htmlAttribule, view does not trigger call
htmlAttributes: new { title = slot.ToolTip, style = "color:" + slot.Color }
}
I need to build list of hyperlink(ActionLink) from the collection. After applying htmlAttribute in following code, ActionLink does not trigger back to server.
@foreach (MillitarySlot slot in item.MondaySlots)
{
@Ajax.ActionLink(linkText: @slot.SlotText,
actionName: "CreateIndex",
routeValues: new { someId = slot.Id },
ajaxOptions: new AjaxOptions
{
UpdateTargetId = "divCreateSchedule",
InsertionMode = InsertionMode.Replace,
HttpMethod = "post"
},
//After adding following htmlAttribule, view does not trigger call
htmlAttributes: new { title = slot.ToolTip, style = "color:" + slot.Color }
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
例如,尝试在 slot.Color } 之后添加括号。
Try adding a bracket after slot.Color } for example..