我有一个配置类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace VCProjectHost
{
public static class Configs
{
public static string SiteName { get; set; }
static Configs()
{
SiteName = "Ahmadali Shafiee's Projects Host";
}
}
}
这是我的一部分_Layout.cshtml
<title>
@{
Write(ViewBag.Title);
if (ViewBag.Title != null)
{
Write(" | ");
}
Write(VCProjectHost.Configs.SiteName);
}
</title>
但Write(VCProjectHost.Configs.SiteName);
抛出一个错误,Configs
说不存在!