我建立了称为<代码>的习俗属性。
[AttributeUsage(AttributeTargets.Property)]
public class RouteAttribute : Attribute
{
public string Url { get; set; }
public bool CheckPhysicalUrlAccess { get; set; }
public RouteValueDictionary Defaults { get; set; }
public RouteValueDictionary Constraints { get; set; }
public RouteValueDictionary DataTokens { get; set; }
}
用于在我的助手班上添加行道,其中包括我的现场的导游名单,这样我就能够方便地管理我的工地。
Having a problem with adding a default though, getting compiler error:
[Route("~/MyPage/Home.aspx", new RouteValueDictionary { { "query", "value" } })]
public string HomePage
{
get { return "Home" }
}
To avoid confusion, the value is set to the routeurl, physical url is from attribute, reason for this is, I am converting an existing site, and rather than changing links everywhere, once I m done with page, I go to my class and change the physical url to new page
犯错误:
属性论点必须经常表达、表达类型或阵列的形成,表明属性参数类型