Example #1
0
 protected void btnDeleteProfilePic_Click(object sender, EventArgs e)
 {
     try
     {
         UserProfileInfo objinfo = new UserProfileInfo();
         objinfo = UserProfileController.GetProfile(GetUsername, GetPortalID);
         if (objinfo.Image != "")
         {
             string imagePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory) + "UserPic/" + objinfo.Image;
             string path      = Server.MapPath(imagePath);
             if (File.Exists(path))
             {
                 File.Delete(path);
             }
         }
         UserProfileController.DeleteProfilePic(GetUsername, GetPortalID);
         ShowHideProfile();
         GetUserDetails();
         LoadUserDetails();
         Session[SessionKeys.Profile_Image] = null;
     }
     catch (Exception)
     {
         throw;
     }
 }