C#新用法

public ActionResult Detail(Guid id){
    QueryEntity query = new QueryEntity;
    query.Id =id;
}
 
pulibc ActionResult Detail(QueryEntity   query) {}
都能从/Detail?id=8 中接收到参数
 
 
“@”字符后不应有“using”关键字。在代码内部,不需要在像“using”这样的构造前加上前缀“@”。
@using {
内部用using不需要在加@
}
————————————————————————————————————
在其他Areas中访问别的Areas时候,使用绝对路径,需要这样写
@Html.Partial("~/Areas/Systems/Views/RoleType/Parts/List.cshtml")
@Html.Partial("/Areas/Systems/Views/RoleType/Parts/List.cshtml")


记得后边一定带上.cshtml,这样不用路由去猜了
————————————————————————————————————
 
@Html.Action("UserRolePanel", "Role", new { Area = "Systems" } )  多个区的Action用法
 
 
未找到路径“/Systems/Application/index”的控制器或该控制器未实现 出现这个错误,是没有加new { area = "" }
————————————————————————————————————
 

posted on 2017-07-26 16:17  土金豪  阅读(206)  评论(0编辑  收藏  举报