阅读背景:

获取公共对象的可访问性错误

来源:互联网 
namespace MyApp.MyNamespace
{
    public class MyClass:System.Web.UI.Page
    {
        private DataUtility Util = new DataUtility();
        private CookieData cd = MyClass.Toolbox.GetCurrentCookieData(HttpContext.Current);
        //below I get the error: "System.Web.UI.Util is unavailable due to its protection level"
        private int CompanyID = Util.GetCompanyIDByUser(cd.Users);

    protected override void OnLoad(EventArgs e)
    {
        //I'd like to use CompanyID here
    }           

    protected void MyEventHandler(object sender, EventArgs e)
    {
        //as well as here
    }
}
namespace MyApp.MyNamespace
{
    public class 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: