Example #1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            Navigation navigation = new Navigation();
            navigation.Page = this;

            presenter = new HomePresenter(this, navigation);
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["userService"] == null)
                Session["userService"] = new SL_User();

            this.serviceUser = (SL_User)Session["userService"];

            presenter.Initialize(IsPostBack);

            this.lblComments.Text = String.Empty;

            // Not clean!
            try
            {
                this.GrdVwSnipeList.DataSource = this.userService.GetActiveSnipes();
                this.GrdVwSnipeList.DataBind();

                if (this.GrdVwSnipeList.Rows.Count == 0)
                    this.lblComments.Text = "No snipe to be displayed.<br/>";
            }
            catch
            {
                Navigation navigation = new Navigation();
                navigation.Page = this;
                navigation.NavigateToPage(EnumView.Error, null);
            }
        }