0
dermeister created
Hey,
There's an easy solution for using current userId in spa applications but what is the way of using logined userId in cshtml mp application.
1 Answer(s)
-
0
Open your view base (it's something like that: <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero-template/blob/master/src/AbpCompanyName.AbpProjectName.WebMpa/Views/AbpProjectNameWebViewPageBase.cs">https://github.com/aspnetboilerplate/mo ... ageBase.cs</a>).
Add a property like that:
public IAbpSession AbpSession { get; private set; }
- Set it in your constructor:
AbpSession = IocManager.Instance.Resolve<IAbpSession>();
- In your cshtml files, just use AbpSession.UserId
Have a nice day.