Ajax.ActionLink() does not fire after putting htmlAttributes
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 foll开发者_开发百科owing htmlAttribule, view does not trigger call
htmlAttributes: new { title = slot.ToolTip, style = "color:" + slot.Color }
}
Try adding a bracket after slot.Color } for example..
@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 })
}
精彩评论