protected void Page_Load(object sender, EventArgs e) { this.TableName = Request.QueryString["blogcategory"]; if (string.IsNullOrEmpty(this.TableName)) { this.TableName = "blog"; } DAL.BlogList blogList = new DAL.BlogList(new SiteData().ConnectionString); blogList.MaxRecords = this.MaxRecords; blogList.CategId = this.TableName; blogList.LoadBlogCategories(); rptBlogs.DataSource = blogList.Blogs; rptBlogs.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string urlID = Request.QueryString["blog"]; if (urlID != null) { /*DAL.BlogList blogList = new DAL.BlogList(new SiteData().ConnectionString, urlID);*/ DAL.BlogList blogList = new DAL.BlogList(new SiteData().ConnectionString); blogList.TableName = this.TableName; blogList.UrlId = urlID; blogList.LoadByUrlId(); if (blogList.Blogs.Count == 0) { Server.Transfer("/PageNotFound.aspx"); } else { rptBlogs.DataSource = blogList.Blogs; rptBlogs.DataBind(); SiteVariables vars = new SiteVariables(); Page.Title = blogList.Blogs[0].Title + " - Blogs - " + vars["sitename"]; } if (this.TableName == "stories") { this.LinkBack = "Journey"; } else { this.LinkBack = this.TableName; } } }