简体   繁体   中英

enum in codebehind file `some.aspx.cs` not accessible

I have website project .
Inside of that I have,
App_Code folder
CSharp folder
Models.cs class file
CommonFunctions.cs class file
Models.cs

    using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Models
/// </summary>
public class Models
{
    public Models()
    {
        //
        // TODO: Add constructor logic here
        //
    }
}
public enum InsuranceType { firstType, secondType}

Now I can access this enum in CommonFunctions.cs file like InsuranceType.firstType .

But I can't access this enum in default.aspxs.cs page.

Why? Or what is missing?

在两个.CS文件中都定义名称空间,然后尝试重新构建。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM