TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marius Vasile
590
1.9k
146.2k
asp.net core razor use of role in view
Dec 4 2020 4:23 AM
I want to be able to give users access to view sections of the View and I can do that with
@
if
(Model.UserDataRole.RoleName ==
"Issuer"
)
{
//some divs here
}
and if
@
if
(Model.UserDataRole.RoleName ==
"Admin"
)
{
//other divs here
}
My questions, is it safe to do so or I should try to do it in the cshtml.cs instead?
Reply
Answers (
6
)
how to hide print button when pdf is opened in browser using asp.net
How can i implement Shiprocket API in my ASP.NET code