protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { User user = (User)Session["LoggedUser"]; if (user == null) Response.Redirect("/Default.aspx"); FacebookAccountRepository objFbRepo = new FacebookAccountRepository(); TeamMemberProfileRepository objTeamMemberProfileRepository = new TeamMemberProfileRepository(); SocioBoard.Domain.Team team = (SocioBoard.Domain.Team)Session["GroupName"]; List<TeamMemberProfile> allprofiles = objTeamMemberProfileRepository.getTeamMemberProfileData(team.Id); //List<FacebookAccount>arrfbPrfile=new List<FacebookAccount>(); ArrayList arrfbPrfile = new ArrayList(); try { foreach (TeamMemberProfile item in allprofiles) { //fbpId += item.ProfileId + ','; FacebookAccount arrfbProfile = objFbRepo.getAllFbAccountDetail(item.ProfileId); if (arrfbProfile.FbUserId != null) { arrfbPrfile.Add(arrfbProfile); } } } catch (Exception ex) { logger.Error(ex.Message); } //fbpId = fbpId.Substring(0, fbpId.Length - 1); //List<FacebookAccount> arrfbProfile = objFbRepo.getAllFbAccountDetail(fbpId); //ArrayList arrfbProfile = fbAccRepo.getAllFacebookPagesOfUser(user.Id); spandiv.InnerHtml = "from " + DateTime.Now.AddDays(-15).ToShortDateString() + "-" + DateTime.Now.ToShortDateString(); try { foreach (FacebookAccount item in arrfbPrfile) { string imgPath = "http://graph.facebook.com/" + item.FbUserId + "/picture"; fbUser = fbUser + "<div class=\"teitter\"><ul><li><a id=\"facebook_connect\" onclick='getProfilefbGraph(\"" + item.FbUserId + "\",\"" + item.FbUserName + "\",\"" + imgPath + "\",\"" + item.AccessToken + "\")'><span style=\"float:left;margin: 3px 0 0 5px;\" >" + item.FbUserName + "</span></a></li></ul></div>"; fbProfileId = item.FbUserId; Session["fbprofileId"] = fbProfileId; divPageName.InnerHtml = item.FbUserName; fbProfileImg.Src = "http://graph.facebook.com/" + item.FbUserId + "/picture"; strfbAccess = item.AccessToken; Session["acstknfnpg"] = strfbAccess; } } catch (Exception ex) { logger.Error(ex.Message); } if (arrfbPrfile.Count > 0) { try { getAllGroupsOnHome.InnerHtml = fbUser; strFbAgeArray = fbiHelper.getLikesByGenderAge(fbProfileId, 15); strPageImpression = fbiHelper.getPageImressions(fbProfileId, 15); strLocationArray = fbiHelper.getLocationInsight(fbProfileId, 15); strstoriesArray = fbiHelper.getStoriesCount(fbProfileId, 15); //divpost.InnerHtml = fbiHelper.getPostDetails(fbProfileId, user.Id, 15); likeunlikedate = objfbstatsHelper.getlikeUnlike(fbProfileId, 15); FacebookClient fb = new FacebookClient(); fb.AccessToken = strfbAccess; dynamic pagelikes = fb.Get(fbProfileId); divPageLikes.InnerHtml = pagelikes.likes.ToString() + " Total Likes " + pagelikes.talking_about_count + " People talking about this."; spanTalking.InnerHtml = pagelikes.talking_about_count.ToString(); string fanpost = PageFeed(strfbAccess, fbProfileId); divpost.InnerHtml = fanpost; } catch (Exception ex) { logger.Error(ex.Message); } } } } catch (Exception Err) { logger.Error(Err.Message); Response.Write(Err.Message); } }