private void BindData(ContentPageItem page) { hlFacebook.NavigateUrl = SocialHelper.GetFacebookShareUrl(page); hlFacebook.Text = DictionaryConstants.SocialSharingFacebook; hlGooglePlus.NavigateUrl = SocialHelper.GetGooglePlusShareUrl(page); hlGooglePlus.Text = DictionaryConstants.SocialSharingGooglePlus; hlTwitter.NavigateUrl = SocialHelper.GetTwitterShareUrl(page, page.PageTitle.Raw); hlTwitter.Text = DictionaryConstants.SocialSharingTwitter; hlPinterest.NavigateUrl = SocialHelper.GetPinterestShareUrl(page); }
protected void rptFavorites_ItemDataBound(object sender, RepeaterItemEventArgs e) { var item = e.Item.DataItem as FavoritesModel; HyperLink hypFavoriteTitle = (HyperLink)e.Item.FindControl("hypFavoriteTitle"); hypFavoriteTitle.NavigateUrl = item.Url; hypFavoriteTitle.Text = item.Title; Literal litType = (Literal)e.Item.FindControl("litType"); litType.Text = item.Type; HyperLink hypReplyCount = (HyperLink)e.Item.FindControl("hypReplyCount"); hypReplyCount.NavigateUrl = item.Url; hypReplyCount.Text = "<span>" + item.ReplyCount + "</span>"; HtmlButton lbUnSave = (HtmlButton)e.Item.FindControl("lbUnSave"); lbUnSave.ServerClick += new EventHandler(lbUnsave_Click); HyperLink hlFacebook = (HyperLink)e.Item.FindControl("hlFacebook"); hlFacebook.NavigateUrl = SocialHelper.GetFacebookShareUrl(Sitecore.Context.Database.GetItem(item.ContentId)); Literal ltlFacebook = (Literal)e.Item.FindControl("ltlFacebook"); ltlFacebook.Text = DictionaryConstants.SocialSharingFacebook; HyperLink hlGooglePlus = (HyperLink)e.Item.FindControl("hlGooglePlus"); hlGooglePlus.NavigateUrl = SocialHelper.GetGooglePlusShareUrl(Sitecore.Context.Database.GetItem(item.ContentId)); Literal ltlGooglePlus = (Literal)e.Item.FindControl("ltlGooglePlus"); ltlGooglePlus.Text = DictionaryConstants.SocialSharingGooglePlus; HyperLink hlTwitter = (HyperLink)e.Item.FindControl("hlTwitter"); hlTwitter.NavigateUrl = SocialHelper.GetTwitterShareUrl(Sitecore.Context.Database.GetItem(item.ContentId), item.Title); Literal ltlTwitter = (Literal)e.Item.FindControl("ltlTwitter"); ltlTwitter.Text = DictionaryConstants.SocialSharingTwitter; }