private void UpdateUi(User user) { if (!string.IsNullOrEmpty(user.ProfilePicPath)) { profileImage.ImageUrl = "~/UploadImages/" + user.ProfilePicPath; } else { profileImage.ImageUrl = "~/UploadImages/noimage.jpg"; } txtEmail.Text = user.EmailAddress; txtFname.Text = user.FirstName; txtLname.Text = user.LastName; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["user"] != null) { user = new UserLogicLayer().GetUser(Session["user"].ToString()); UpdateUi(user); } else { Response.Redirect("~/Login.aspx"); } } else { user = new UserLogicLayer().GetUser(Session["user"].ToString()); } }