日期:2014-05-18  浏览次数:20458 次

怎样获取当前登录用户的ID(或用户名)?
因为使用的是登录控件自动创建的登录入口,所以无法设置session,是否有办法知道当前登录用户的ID(或者用户名)?

------解决方案--------------------
HttpContext.Current.User.Identity.Name
------解决方案--------------------
HttpContext.Current.User.Identity.Name
------解决方案--------------------
在继承Page类中直接引用
Context.Current.User.Identity.Name即可~