private void SetSitemap() { try { using (DataClassesDataContext data = new DataClassesDataContext()) { var cont = data.GetContent(265).ToList(); Label lblSitemap1 = (Label)Master.FindControl("lblSitemap1"); if (lblSitemap1 != null) lblSitemap1.Text = cont[0].TIEUDE; } } catch (Exception ex) { // error message here } }
private void GetContent() { try { using (DataClassesDataContext data = new DataClassesDataContext()) { var cont = data.GetContent(int.Parse(Request.QueryString["nid"])).ToList(); Label lblSitemap1 = (Label)Master.FindControl("lblSitemap1"); HtmlAnchor sitemapSplit = (HtmlAnchor)Master.FindControl("sitemapSplit"); Label lblSitemap2 = (Label)Master.FindControl("lblSitemap2"); if (lblSitemap1 != null && sitemapSplit != null && lblSitemap2 != null) { lblSitemap1.Text = cont[0].FATHER; sitemapSplit.InnerText = "»"; lblSitemap2.Text = cont[0].TIEUDE; } lblContent.Text = cont[0].NOIDUNG; } } catch (Exception ex) { // error message here } }