c# asp.net page head,meta,title,css

复制代码
 1 protected void Page_Load(object sender, EventArgs e)
 2         {
 3             //Page title 4.   
 4             Page.Title = "This is a title and meta test page.";
 5             //Encode/Content type 7.   
 6             HtmlMeta encode = new HtmlMeta();
 7             encode.HttpEquiv = "Content-Type";
 8             encode.Content = "text/html; charset=utf-8";
 9             Page.Header.Controls.Add(encode);
10             //Language 13.   
11             HtmlMeta lang = new HtmlMeta();
12             lang.HttpEquiv = "Content-Language";
13             lang.Content = "zh-cn";
14             Page.Header.Controls.Add(lang);
15             //Description 19.   
16             HtmlMeta desc = new HtmlMeta();
17             desc.Name = "Description";
18             desc.Content = "涂聚文,捷为工作室,经营信息流,物流,人力资源流,资本流的系统解决方案的开发与设计和服务,geoVI studio.Geovin Du. Systems Solution to Fund flow,and Information flow,and Material flow,and Control flow,and Human Resource.Applied software development,design and service";
19             Page.Header.Controls.Add(desc);
20             //Keyword 25.   
21             HtmlMeta keywords = new HtmlMeta();
22             keywords.Name = "keywords";
23             keywords.Content = "涂聚文,捷为工作室,经营信息流,物流,人力资源流,资本流的系统解决方案的开发与设计和服务";
24             Page.Header.Controls.Add(keywords);
25             //Robots
26             HtmlMeta Robots = new HtmlMeta();
27             Robots.Name = "Robots";
28             Robots.Content = "all index follow";
29             Page.Header.Controls.Add(Robots);
30             //Author
31             HtmlMeta Author = new HtmlMeta();
32             Author.Name = "Author";
33             Author.Content = "涂聚文";
34             Page.Header.Controls.Add(Author);
35               
36             //shortcut icon
37             HtmlLink shortcuticon = new HtmlLink();
38             shortcuticon.Href = "favicon.ico";
39             shortcuticon.Attributes.Add("rel""shortcut icon");
40             shortcuticon.Attributes.Add("type""image/x-icon");
41             Page.Header.Controls.Add(shortcuticon);
42             //icon
43             HtmlLink icon = new HtmlLink();
44             icon.Href = "favicon.ico";
45             icon.Attributes.Add("rel""icon");
46             icon.Attributes.Add("type""image/ico");
47             Page.Header.Controls.Add(icon);
48             //bookmark
49             HtmlLink bookmark = new HtmlLink();
50             bookmark.Href = "favicon.ico";
51             bookmark.Attributes.Add("rel""bookmark");
52             bookmark.Attributes.Add("type""image/ico");
53             Page.Header.Controls.Add(bookmark);
54 
55            //Link/CSS 31.
56             HtmlLink cssLink = new HtmlLink();
57             cssLink.Href = "MasterPage.css";
58             cssLink.Attributes.Add("rel""stylesheet");
59             cssLink.Attributes.Add("type""text/css");
60             Page.Header.Controls.Add(cssLink);
61 
62             //SqlDataSource sd = new SqlDataSource();
63             //sd.SelectCommand = "";
64             //sd.DataBind();
65             //访问来源
66             string refHost = HttpContext.Current.Request.UrlReferrer == null ? "" : HttpContext.Current.Request.UrlReferrer.Host.ToLower();
67             Response.Write("from: "+refHost);
68             if (!IsPostBack)
69                 FreezeGridviewHeader(GridView1, _tb, PanelContainer);
70         }
复制代码
posted @   ®Geovin Du Dream Park™  阅读(553)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
< 2011年3月 >
27 28 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 1 2
3 4 5 6 7 8 9
点击右上角即可分享
微信分享提示