本文整理汇总了C#中System.Web.UI.WebControls.RepeaterItemEventArgs.IsItem方法的典型用法代码示例。如果您正苦于以下问题:C# RepeaterItemEventArgs.IsItem方法的具体用法?C# RepeaterItemEventArgs.IsItem怎么用?C# RepeaterItemEventArgs.IsItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.RepeaterItemEventArgs
的用法示例。
在下文中一共展示了RepeaterItemEventArgs.IsItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: rptRow_ItemDataBound
protected void rptRow_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
Item dataItem = e.Item.DataItem as Item;
if(dataItem.InheritsTemplate(DefaultArticlePageItem.TemplateId))
{
DefaultArticlePageItem article = (DefaultArticlePageItem)dataItem;
System.Web.UI.WebControls.Image imgThumbnail = e.FindControlAs<System.Web.UI.WebControls.Image>("imgThumbnail");
HyperLink hypArticleLink = e.FindControlAs<HyperLink>("hypArticleLink");
HyperLink hypThumbnail = e.FindControlAs<HyperLink>("hypThumbnail");
if (imgThumbnail != null)
imgThumbnail.ImageUrl = article.GetArticleThumbnailUrl(230, 129);
if (hypArticleLink != null)
{
hypArticleLink.NavigateUrl = hypThumbnail.NavigateUrl = article.GetUrl();
hypArticleLink.Text = article.ContentPage.PageTitle;
}
}
}
}
示例2: rptMainNavigation_ItemDataBound
protected void rptMainNavigation_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
var item = e.Item.DataItem as NavigationLinkItem;
if (item != null)
{
var frMainNavigationLink = e.FindControlAs<FieldRenderer>("frMainNavigationLink");
if (frMainNavigationLink != null)
{
frMainNavigationLink.Item = item;
}
var results = item.GetNavigationLinkItems();
if (results != null && results.Any())
{
var rptPrimaryNav = e.FindControlAs<Repeater>("rptPrimaryNavigation");
if (rptPrimaryNav != null)
{
rptPrimaryNav.DataSource = results;
rptPrimaryNav.DataBind();
}
}
}
}
}
示例3: rptWelcomeSlider_ItemDataBound
protected void rptWelcomeSlider_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
WelcomeTourItem item = e.Item.DataItem as WelcomeTourItem;
if (item != null)
{
Sitecore.Web.UI.WebControls.Image scBackgroundImage = e.FindControlAs<Sitecore.Web.UI.WebControls.Image>("scBackgroundImage");
FieldRenderer frContent = e.FindControlAs<FieldRenderer>("frContent");
Link scLinkJoin = e.FindControlAs<Link>("scLinkJoin");
HyperLink hlNotNow = e.FindControlAs<HyperLink>("hlNotNow");
if (frContent != null)
{
frContent.Item = item;
}
if (scBackgroundImage != null)
{
scBackgroundImage.Item = item;
}
if (scLinkJoin != null)
{
scLinkJoin.Item = item;
}
if (hlNotNow != null)
{
hlNotNow.Text = DictionaryConstants.NotNowLabel;
}
}
}
}
示例4: rptChildren_ItemDataBound
void rptChildren_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
Child child = (Child)e.Item.DataItem;
Literal litGrade = (Literal)e.Item.FindControl("litGrade");
Literal litChildInfo = (Literal)e.Item.FindControl("litChildInfo");
string childPrefix = string.Empty;
var grade = child.Grades.FirstOrDefault();
if (grade != null)
{
GradeLevelItem gli = Sitecore.Context.Database.GetItem(grade.Key);
if (gli != null)
{
litGrade.Text = gli.AbbreviatedGrade.Raw;
childPrefix = String.Concat(gli.Name.Raw, ", ");
}
}
litChildInfo.Text = String.Concat(childPrefix, MembershipHelper.GetLocalizedGender(child.Gender));
Repeater rptIssues = e.FindControlAs<Repeater>("rptIssues");
if (child.Issues.Any())
{
var issues = child.Issues.Select(x => (ChildIssueItem)Sitecore.Context.Database.GetItem(x.Key))
.Where(x => x != null);
rptIssues.DataSource = issues;
rptIssues.DataBind();
}
}
}
示例5: rptLinks_ItemDataBound
private void rptLinks_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
NavigationLinkItem item = (NavigationLinkItem)e.Item.DataItem;
FieldRenderer frLink = e.FindControlAs<FieldRenderer>("frLink");
frLink.Item = item;
if (item.Link.Field != null)
{
// Handle initial menu choice
if (e.Item.ItemIndex == 0)
{
litInitialMenuChoice.Text = item.Link.Field.Text;
}
// Selected state
Item navItem = Sitecore.Context.Item;
while (navItem != null)
{
if (item.Link.Field.TargetID == navItem.ID)
{
frLink.Parameters = "class=selected";
break;
}
navItem = navItem.Parent;
}
}
}
}
示例6: rptPromoDetails_ItemDataBound
protected void rptPromoDetails_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
PromoItem currentPromo = e.Item.DataItem as PromoItem;
if (currentPromo != null)
{
Panel pnlImageType = e.FindControlAs<Panel>("pnlImageType");
if (pnlImageType != null)
{
if (currentPromo.ShowMediaFile.Checked==true)
{
pnlImageType.CssClass+=" video";
}
HyperLink hlPromoMedia = e.FindControlAs<HyperLink>("hlPromoMedia");
if (hlPromoMedia != null)
{
FieldRenderer frPromoMedia = e.FindControlAs<FieldRenderer>("frPromoMedia");
if (frPromoMedia != null)
{
frPromoMedia.Item = currentPromo;
}
}
FieldRenderer frPromoTitle = e.FindControlAs<FieldRenderer>("frPromoTitle");
if (frPromoTitle != null)
{
frPromoTitle.Item = currentPromo;
}
}
}
}
}
示例7: rptSlideButtons_ItemDataBound
void rptSlideButtons_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Header)
{
Literal ltlPrev = e.FindControlAs<Literal>("ltlPrev");
ltlPrev.Text = DictionaryConstants.PrevTipButtonText;
}
if (e.IsItem())
{
string buttonNumber = (e.Item.ItemIndex + 1).ToString();
HtmlButton hgcButton = e.FindControlAs<HtmlButton>("hgcButton");
hgcButton.InnerText = buttonNumber;
hgcButton.Attributes["data-target"] = buttonNumber;
}
if (e.Item.ItemType == ListItemType.Footer)
{
Literal ltlNext = e.FindControlAs<Literal>("ltlNext");
Literal ltlLast = e.FindControlAs<Literal>("ltlLast");
ltlNext.Text = DictionaryConstants.NextTipButtonText;
ltlLast.Text = DictionaryConstants.LastTipButtonText;
}
}
示例8: rptArticles_ItemDataBound
void rptArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
DefaultArticlePageItem item = (DefaultArticlePageItem)e.Item.DataItem;
Sublayout sbArticleEntry = e.FindControlAs<Sublayout>("sbArticleEntry");
sbArticleEntry.DataSource = item.ID.ToString();
}
}
示例9: rptEvents_ItemDataBound
void rptEvents_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
BaseEventDetailPageItem item = (BaseEventDetailPageItem)e.Item.DataItem;
Sublayout slEventArchive = e.FindControlAs<Sublayout>("slEventArchive");
slEventArchive.DataSource = item.ID.ToString();
}
}
示例10: rptTips_ItemDataBound
void rptTips_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
BehaviorAdvicePageItem item = (BehaviorAdvicePageItem)e.Item.DataItem;
HyperLink hlTip = e.FindControlAs<HyperLink>("hlTip");
hlTip.NavigateUrl = item.GetUrl();
hlTip.Text = item.TipTitle;
}
}
示例11: rptRelatedArticles_ItemDataBound
void rptRelatedArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
Item item = (Item)e.Item.DataItem;
HyperLink hlArticleLink = e.FindControlAs<HyperLink>("hlArticleLink");
hlArticleLink.NavigateUrl = item.GetUrl();
BehaviorAdvicePageItem behaviorItem = item;
hlArticleLink.Text = !String.IsNullOrEmpty(behaviorItem.TipTitle) ? behaviorItem.TipTitle : behaviorItem.BasePageNEW.NavigationTitle;
}
}
示例12: rptWidgets_ItemDataBound
void rptWidgets_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
Item item = (Item)e.Item.DataItem;
Sublayout slWidget = e.FindControlAs<Sublayout>("slWidget");
slWidget.DataSource = item.ID.ToString();
slWidget.Path = ToolWidgetItem.GetWidgetSublayoutPath(item);
}
}
示例13: rptChildIssues_ItemDataBound
protected void rptChildIssues_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
ChildIssueItem childIssueItem = e.Item.DataItem as ChildIssueItem;
HtmlInputCheckBox inputIssue = e.FindControlAs<HtmlInputCheckBox>("inputIssue");
Literal litIssueName = e.FindControlAs<Literal>("litIssueName");
inputIssue.Attributes.Add("data-id", childIssueItem.ID.ToString());
litIssueName.Text = childIssueItem.IssueName.Raw;
}
}
示例14: rptArticles_ItemDataBound
void rptArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
DefaultArticlePageItem item = (DefaultArticlePageItem)e.Item.DataItem;
HyperLink hlArticleDetail = e.FindControlAs<HyperLink>("hlArticleDetail");
hlArticleDetail.NavigateUrl = item.GetUrl();
System.Web.UI.WebControls.Image imgThumbnail = e.FindControlAs<System.Web.UI.WebControls.Image>("imgThumbnail");
imgThumbnail.ImageUrl = item.GetArticleThumbnailUrl(230, 129);
FieldRenderer frPageTitle = e.FindControlAs<FieldRenderer>("frPageTitle");
frPageTitle.Item = item;
}
}
示例15: rptComments_ItemDataBound
protected void rptComments_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.IsItem())
{
Comment comment = (Comment)e.Item.DataItem;
Panel pnlAuthor = (Panel)e.FindControlAs<Panel>("pnlAuthor");
Panel pnlComment = (Panel)e.FindControlAs<Panel>("pnlComment");
HyperLink hlTitle = e.FindControlAs<HyperLink>("hlTitle");
ContentPageItem item = Sitecore.Context.Database.GetItem(comment.SitecoreId);
if (item != null)
{
hlTitle.NavigateUrl = item.GetUrl();
hlTitle.Text = item.PageTitle.Rendered;
}
Literal litDate = e.FindControlAs<Literal>("litDate");
litDate.Text = UnderstoodDotOrg.Common.Helpers.DataFormatHelper.FormatDate(comment.CommentDate);
Literal litComment = e.FindControlAs<Literal>("litComment");
litComment.Text = UnderstoodDotOrg.Common.Helpers.TextHelper.TruncateText(
Sitecore.StringUtil.RemoveTags(HttpUtility.HtmlDecode(comment.Body)), commentCharLimit);
Literal litLikeCount = e.FindControlAs<Literal>("litLikeCount");
litLikeCount.Text = comment.Likes;
if (e.Item.ItemIndex == 0 && DisplayAuthorInfo && ProfileMember != null)
{
pnlAuthor.Visible = true;
Literal litScreenName = e.FindControlAs<Literal>("litScreenName");
litScreenName.Text = ProfileMember.ScreenName;
Literal litLastUpdated = e.FindControlAs<Literal>("litLastUpdated");
MembershipManager mm = new MembershipManager();
var user = mm.GetUser(ProfileMember.MemberId);
litLastUpdated.Text = user.LastActivityDate.ToString("hh:mmtt on MMM dd yyyy");
}
else
{
pnlComment.CssClass += " offset-6";
}
}
}