我正在尝试创建一个Telerik网格视图,但是当我去参考kendo时它无法识别它.当我尝试引用kendo时,Visual Studio给出了一个错误.这是代码@(Html.Kendo().Grid),下面是错误.
'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Kendo' and no extension method 'Kendo' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
我在BundleConfig文件中为Scripts和Content添加了一个包.此外,我已经添加@Scripts.Render("~/bundles/kendo")并@Styles.Render("/Content/kendo")直接向Razor视图.
我读过的很多文章都表明添加<add namespace="Kendo.Mvc.UI"/>到Web.Config文件会起作用,但它仍然会抛出相同的错误.
有什么东西我错过了吗?
我创建的网站要求管理员帐户为用户创建帐户.如何让这些用户在首次登录后更改密码?问题是用户将有一个通用密码指定给他们,他们决定第一次登录后,我希望他们必须将他们的密码更改为不太通用的东西.
这是我的登录控制器
[AllowAnonymous]
public ActionResult Login(string returnUrl)
{
ViewBag.ReturnUrl = returnUrl;
return View();
}
//
// POST: /Account/Login
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
{
if (ModelState.IsValid)
{
var user = await UserManager.FindAsync(model.UserName, model.Password);
if (user != null)
{
await SignInAsync(user, model.RememberMe);
return RedirectToLocal(returnUrl);
}
else
{
ModelState.AddModelError("", "Invalid username or password.");
}
}
Run Code Online (Sandbox Code Playgroud)
我的登录模型
public class LoginViewModel
{
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")] …Run Code Online (Sandbox Code Playgroud)