Write an Article Write a Tutorial Add a Fast Code* *Fast Code might be any helpful code with brief comment
Stem Cells Blood Banks Insurances .Net Hosting Credit Cards PC Rental Business
Tutorials: ASP .NET C# .NET VB .NET Articles: ASP .NET C# .NET VB .NET Fast Code: ASP .NET C# .NET VB .NET
TextBox TextBox1 = FormView1.FindControl("TextBox1") as TextBox;
Add External Style Sheet to the Header HtmlLink link = new HtmlLink(); link.Attributes.Add("type", "text/css"); link.Attributes.Add("rel", "stylesheet"); link.Attributes.Add("href", "~/main.css"); this.Header.Controls.Add(link);
Add Style attribute for the Page Style style = new Style(); style.ForeColor = System.Drawing.Color.Navy; style.BackColor = System.Drawing.Color.LightGray; this.Header.StyleSheet.CreateStyleRule(style, null, "body"); Add Dynamic Meta tags to the Header HtmlMeta meta = new HtmlMeta(); meta.Name = "keywords"; meta.Content = "Your keywords here"; this.Header.Controls.Add(meta); meta = new HtmlMeta(); meta.Name = "robots"; meta.Content = "noindex"; this.Header.Controls.Add(meta); meta = new HtmlMeta(); meta.Name = "date"; meta.Content = DateTime.Now.ToString("yyyy-MM-dd"); meta.Scheme = "YYYY-MM-DD"; this.Header.Controls.Add(meta); Add Updated Page title to the Page this.Header.Title = "Sue's little edream share with the world"; Also, use sitemap note for your title is a nice option:
Add Page title from the SiteMap Current Node this.Header.Title = SiteMap.CurrentNode.Title + " | " + SiteMap.CurrentNode.Description;
Note: All the above code should be used within page Page_Load event.
27/08/2007 04:48:11 UTC
06/11/2007 20:46:12 UTC
31/01/2008 16:20:45 UTC
18/09/2008 15:04:22 UTC