【问题标题】:Kendo UI Notifications and MVCKendo UI 通知和 MVC
【发布时间】:2015-01-12 10:03:05
【问题描述】:
【问题讨论】:
标签:
asp.net-mvc
asp.net-mvc-4
kendo-ui
kendo-ui-mvc
【解决方案1】:
首先你可以查看这个网站。 http://demos.telerik.com/kendo-ui/notification/templates
我给你举了一个例子。
$(document).ready(function () {
var addUserUrl = "<%=Url.Action("AddUser", "ControlAccount")%>";
$("#addUser").click(function addUserFunc() {
var userName= 'exampleUser';
var password = 'examplePassword';
$.post(addUserUrl, { userName: userName, password: password}, function (data, result) {
var d = new Date();
staticNotification.show(kendo.toString(d, 'HH:MM:ss.') + kendo.toString(d.getMilliseconds(), "000"), text);
var container = $(staticNotification.options.appendTo);
container.scrollTop(container[0].scrollHeight);
});
});
在服务器端;
[HttpPost]
public ActionResult AddUser(string kullaniciAdi, string password)
{
var result = "";
//// Do it your jobs
return Json(result, JsonRequestBehavior.AllowGet);
}