Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            qStyles.Enqueue("orange");
            qStyles.Enqueue("blue");
            qStyles.Enqueue("purple");
            qStyles.Enqueue("green");
            qStyles.Enqueue("red");
            qStyles.Enqueue("grey");

            UserPageBase pageBase = (UserPageBase)Page;
            List<Collective.Category> lstCats = pageBase.ListCategories();
            _selCategory = pageBase.GetSelectedCategory();

            if(_selCategory == null)
            {
                _selCategory = lstCats.FirstOrDefault();
            }

            this.rptCategories.DataSource = lstCats;
            this.rptCategories.DataBind();
        }
    }
    private Collective.Category GetCategory()
    {
        if (_category == null)
        {
            int catId;
            if (Int32.TryParse(Request.QueryString["catid"], out catId) || Int32.TryParse(this.hfCreatedCategoryId.Value, out catId))
            {
                _category = Collective.Category.GetCategory(catId);
            }
        }

        return _category;
    }