using System.ComponentModel; using System.Web.UI.WebControls; using SiberTek.Xenta.Presentation.Presenters; using SiberTek.Xenta.Presentation.Views; using SiberTek.Xenta.Utils; using SiberTek.Xenta.Web.Controls; using SiberTek.Xenta.Web.Utils; namespace SiberTek.Xenta.Web.Home.Modules { public partial class TagList : ViewBase<TagPresenter>, IList { #region Properties [Browsable(false)] public int? PublicationID { get { return (int?)ViewState["PublicationID"]; } set { ViewState["PublicationID"] = value; } } public int ItemCount { get { return lstTagList.Items.Count; } } #endregion #region Methods public override void BindData() { DataContainer["PublicationID"] = PublicationID; Presenter.LoadCollection(); lstTagList.DataSource = DataContainer["TagCollection"]; lstTagList.DataBind(); base.BindData(); } #endregion #region Handlers protected void LstTagList_OnItemDataBound(object sender, RepeaterItemEventArgs e) { RepeaterItem rptItem = e.Item; switch(rptItem.ItemType) { case ListItemType.Item: case ListItemType.AlternatingItem: case ListItemType.SelectedItem: { ViewDataContainer item = rptItem.DataItem as ViewDataContainer; if(item != null) { HyperLink lnkTag = rptItem.FindControl("lnkTag") as HyperLink; lnkTag.NavigateUrl = UrlHelper.FormatUrl("home", "search.aspx?term=&tag={0}", StringHelper.EncodeUrl((string)item["Name"])); lnkTag.Text = (string)item["Name"]; } } break; } } #endregion } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The MIT License