我想在kendo创建动作后返回警报,并且还返回自定义验证,例如:“用户名已被使用”,但
return JavaScript("<script language='javascript'type='text/javascript'>alert('the username is the username Already take');</script>");
不工作!
这是我的行动:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult AddNewCountry([DataSourceRequest]DataSourceRequest request, CountryViewModel c,int countryId)
{
if (c != null && ModelState.IsValid)
{
countryService.Create(c);
}
//return Json(new[] { c }.ToDataSourceResult(request, ModelState));
return JavaScript("<script language='javascript' type='text/javascript'>alert('Thanks for Feedback!');</script>");
}
预先感谢您的帮助