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
Man Down
NA
48
3.4k
How to not list users which have Admin role - Asp.Net MVC 5
Jan 31 2018 3:04 AM
In my table i have two columns Email_ID & Role , for example (Email_ID :
[email protected]
& Role : Admin) and what I'am trying to do is avoid or not showing the users or those have Role as Admin , but the code i have now is showing all users.
My Code look like this :
public
ActionResult AllEmails(string searching,
int
? pageNumber)
{
return
View(db.PX.Where(x => x.Email_ID.Contains(searching) ||
searching == null).ToList().OrderBy(t => t.Role).ToPagedList(pageNumber ?? 1, 5));
}
Reply
Answers (
5
)
How to show status of long running task when import to sql..
Timer and Update Panel