是否可以从局部视图访问基本控制器的属性?
我有以下设置:
public class BaseController : Controller
{
private string ServerName
{
get
{
return Request.ServerVariables["SERVER_NAME"];
}
}
private Entities.Client _Client { get; set; }
public Entities.Client Client
{
get
{
return this._Client ?? (this._Client = this.HttpContext.Application["Client"] as Entities.Client);
}
}
private Settings _Settings { get; set; }
public Settings Settings
{
get
{
if (this._Settings == null)
{
this._Settings = new Settings(this.Client, this.Client.WebPageTemplateCapabilities != null ? SettingsType.XML : SettingsType.SQL);
}
return this._Settings;
}
}
}
我的所有控制器都继承 BaseController,并且在这些控制器的子操作的某些视图中,我呈现部分视图。有没有办法从这些部分视图之一访问 BaseController.Settings ?