用户控件中使用User.Identity

User属于Page类,而用户控件集成自WebControl类,不能直接使用User.Identity的相关属性
可以使用System.Web.HttpContext.Current.User.Identiy来使用
原文地址:https://www.cnblogs.com/lavenderzh/p/970305.html