cshtml 中的 AppState = Context.Application 和 控制器中的 Application 也相等

 

AppState = Context.Application
@{
    ViewBag.Title = "Home Page";

    AppState["s1"] = "狀態一";
}

<div class="jumbotron">
    <p>AppState: @AppState["s1"]</p>
    <p>Context.Application: @Context.Application["s1"]</p>
</div>
相關文章
相關標籤/搜索