我得到了
public ActionResult Index()
{
ViewBag.Roles = AccountRepository.GetRoles();
return PartialView();
}
那么我如何使用带有viewPath的CreateUserViewModel是Account / CreateUser
我是durandal的新人。谢谢!
答案 0 :(得分:0)
因为你正在使用Durandal,所以我猜你正在尝试一个水疗中心(就像我一样)。如果是这样,你真的不需要使用控制器来做到这一点。相反,在页面启动时,将主js文件包含在代码的主体中
@model MvcApplication7.Models.LoginModel
<div id="main-content">
@if (@User.Identity.IsAuthenticated)
{
///main app here
}
else
{
///authorize/sign up here
}
</div>
@if (@User.Identity.IsAuthenticated)
{
@section scripts {
@Scripts.Render("~/bundles/duranal")
@Scripts.Render("~/bundles/etc...")
}
}
这基本上是微风家伙在他们的微风水疗样本项目中使用的模型,你可以在这里找到http://www.breezejs.com/spa-template
祝你好运!PS。街上的一句话是约翰爸爸很快就会有一个多元化的课程,我敢打赌会包括这些东西