在Asp.Net SiteMaster上,只要用户登录成功,用户的用户名就会显示在右上角。代码通常是这样的:
<li><a runat="server" href="~/account/ManagePassword">Hello,<%: Context.User.Identity.Getusername() %> !</a></li>
现在,我要发生的事情是,只要用户成功登录,就会发布用户的全名。
为此,我基本上在表AspNetUser
下配置了Asp.Net的默认数据库,以添加其他列,例如全名。当我尝试使用<%: Context.User.Identity.Fullname()
更改以上代码时,出现错误
'IIdentity' does not contain a definition for 'Fullname' and no extension method 'Fullname' accepting a first argument of type 'IIdentity' could be found (are you missing a using directive or an assembly reference?)
如何使“全名”列填充显示名称?预先感谢。