cshtml AppState = Context.Application and the controller are also equal in the 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>

  

 

Guess you like

Origin www.cnblogs.com/webenh/p/10929940.html