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.
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
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.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)