2

使用 HttpContext.Current.CurrentHandler 进行运行时视图访问是否有任何潜在的陷阱?

public static GetView<T>(T view) where T : IView
{
    return  HttpContext.Current.CurrentHandler as T;
}
4

1 回答 1

1

我不这么认为,只要你知道它可以null

于 2010-02-23T23:12:56.140 回答