Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ModulesDataProvider  dataProvider = new ModulesDataProvider();
            IEnumerable <Module> modules      = dataProvider.SelectModulesAll();

            FeaturedModulesRepeater.DataSource = modules;
            BestModulesRepeater.DataSource     = modules;
            RecentModulesRepeater.DataSource   = modules;

            FeaturedModulesRepeater.DataBind();
            BestModulesRepeater.DataBind();
            RecentModulesRepeater.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int    moduleId = -1;
            string idValue  = Page.RouteData.Values["id"] != null ? Page.RouteData.Values["id"].ToString() : null;

            if (idValue != null)
            {
                bool converted = Int32.TryParse(idValue, out moduleId);
                if (converted)
                {
                    ModulesDataProvider dp = new ModulesDataProvider();
                    Module module          = dp.SelectModuleByPrKey(moduleId);

                    ModuleTitleLabel.Text       = module.Title;
                    ModuleDescriptionLabel.Text = module.Description;
                }
                else
                {
                    // Module not found
                }
            }
        }