62,254
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Web.Caching;
using System.Web;
namespace mm
{
[AttributeUsage(AttributeTargets.Class)]
public class Attr : Attribute
{
/// <summary>
/// 构造方法
/// </summary>
public Attr() {
HttpContext.Current.Cache.Insert("key","阿哈哈");
}
}
}
[Attr]
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write( Cache["key"].ToString());
}