我在Kendo Notification中显示@ Html.ActionLink时出现问题。
一切似乎都有效,但我无法看到链接。这是脚本+ actionlink代码:
notification.show(
{ message: "Onayınızı bekleyen @ViewBag.Sum konu var. Onay için"@Html.ActionLink("ClickMe", "Action", "Controller") " }
, "upload-success");
}
问题出在哪里?
这是我的脚本代码:
@(Html.Kendo().Notification()
.Name("notification")
.Position(p => p.Pinned(true).Top(30).Right(30))
.Stacking(NotificationStackingSettings.Down)
.AutoHideAfter(60000)
.Templates(t =>
{
t.Add().Type("wrong-pass").ClientTemplateID("errorTemplate");
t.Add().Type("upload-success").ClientTemplateID("successTemplate");
})
)
我的模板
<script id="successTemplate" type="text/x-kendo-template">
<div class="upload-success">
<table>
<tr>
<td><img src="../Images/success-icon.png " /></td>
<td><h3>#= message #</h3></td>
</tr>
</table>
</div>
</script>
我的脚本代码:
<script>
$(document).ready(function () {
var a = parseInt(@ViewBag.Sum);
alert(a);
var notification = $("#notification").data("kendoNotification");
if (a >0) {
notification.show(
{ message: "Onayınızı bekleyen @ViewBag.Sum konu var. Onay için"@Html.ActionLink("ClickMe", "Action", "Controller") " }
, "upload-success");
}
else {
notification.show({
message: "Hata Oluştu"
}, "error");
}
});
</script>