Click here to Skip to main content
15,881,204 members
Articles / Web Development / ASP.NET

Open Source Extensible Enterprise n-tier Application Framework with Multilayered Architecture

Rate me:
Please Sign up or sign in to vote.
4.67/5 (2 votes)
3 Dec 2010MIT3 min read 36.8K   770   41  
Xenta architecture overview
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.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions