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
Baybars Bay
1.6k
88
3.8k
Show profile picture when user is logged in and editing user informa
Dec 6 2020 11:10 AM
Hello friends
I want the user picture to appear in the upper right corner when the user logs in and edit user information from there
please I am waiting for your help
I can show the username but I couldn't succeed the others
sample picture:
public
ActionResult Index()
{
if
(Session[
"User_ID"
] !=
null
)
{
return
View(db.UserViewModel.ToList());
}
else
{
return
RedirectToAction(
"LogIn"
,
"UsersInfo"
);
}
}
public
ActionResult LogIn(Models.UsersInfo user)
{
if
(IsValid( user.User_Name, user.Password ))
{
FormsAuthentication.SetAuthCookie(user.User_Name,
false
);
Session[
"User_ID"
] = user.User_ID.ToString();
Session[
"User_Name"
] = user.User_Name.ToString();
return
RedirectToAction(
"Index"
,
"Photos"
);
}
else
{
ModelState.AddModelError(
""
,
"Login details are wrong."
);
}
return
View(user);
}
<li
class
=
"nav-item"
>
@
if
(Session[
"User_ID"
] !=
null
)
{<text>
Welcome @Session[
"User_ID"
].ToString() </text>
<img src=
"@Html.ViewData["
UserPicturePath
"]"
alt=
"Images"
height=
"48"
width=
"48"
/>
}
<li
class
=
"nav-item"
>
@
if
(Session[
"User_Name"
] !=
null
)
{<text>
Welcome @Session[
"User_Name"
].ToString() </text>
}
</li>
Reply
Answers (
1
)
asp.net core razor pages rerouting between three pages
convert base64 to pdf and display in mvc