Using the following snippet worked just fine in mvc2:
使用下面的代码片段在mvc2中效果很好:
<%= Profile %>
But in my razor view I do not have access to Profile. Where do I get it from now?
但是在我的剃刀视图中,我没有访问配置文件的权限。从现在起我从哪里得到它?
1 个解决方案
#1
1
You can get it like this:
你可以这样理解:
@{
var profile = Context.Profile;
}
#1
1
You can get it like this:
你可以这样理解:
@{
var profile = Context.Profile;
}