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>