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
shahnid k
NA
61
15.5k
To check a string contains specific word(here its user).
Jan 12 2017 2:44 AM
Hi,
I need to check a string contains a specific user. If user exist, need to enable button else disable it. I have used two strings. One hard coded and other taking the user name once a user logged in. And i need to check the user name in the list of hardcoded string.
here is what i have written. But its not correct.
Eg:
string username can take "xyzcom\\design.department" then the button should be shown.
string
finUser =
"xyzcom\\design.department,xyzcom\\basil.jad,xyzcom\\aloshi.alex, xyzcom\\michel felx,xyzcom\\karim.hal,xyzcom\\shah shaan "
;
string
username = Page.User.Identity.Name; //"
xyzcom\\design.department" eg
if
(finUser.Any(username.Contains))
{
Button2.Visible =
true
;
}
else
{
Button2.Visible =
false
;
}
Reply
Answers (
4
)
Hi i need to display pdf documents this flipbook
Httpcontext.Current.Session vs Session