asp.net 网页title怎么不显示
3个回答
展开全部
如果你用了模板页 title是不显示的
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="aboutus.aspx.cs" Inherits="aboutus" Title="Untitled Page" %>
这句话里可以改 最后那个 Untitled Page 可以改的
还有就是 赋值
protected void Page_Load(object sender, EventArgs e)
{
//Page title
Page.Title = "This is a title and meta test page.";
//Encode/Content type
HtmlMeta encode = new HtmlMeta();
encode.HttpEquiv = "Content-Type";
encode.Content = "text/html; charset=utf-8";
Page.Header.Controls.Add(encode);
//Language
HtmlMeta lang = new HtmlMeta();
lang.HttpEquiv = "Content-Language";
lang.Content = "zh-cn";
Page.Header.Controls.Add(lang);
//Description
HtmlMeta desc = new HtmlMeta();
desc.Name = "Description";
desc.Content = "Test the meta controls";
Page.Header.Controls.Add(desc);
//Keyword
HtmlMeta keywords = new HtmlMeta();
keywords.Name = "keywords";
keywords.Content = "title,meta,test,page";
Page.Header.Controls.Add(keywords);
}
你应该能看懂
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="aboutus.aspx.cs" Inherits="aboutus" Title="Untitled Page" %>
这句话里可以改 最后那个 Untitled Page 可以改的
还有就是 赋值
protected void Page_Load(object sender, EventArgs e)
{
//Page title
Page.Title = "This is a title and meta test page.";
//Encode/Content type
HtmlMeta encode = new HtmlMeta();
encode.HttpEquiv = "Content-Type";
encode.Content = "text/html; charset=utf-8";
Page.Header.Controls.Add(encode);
//Language
HtmlMeta lang = new HtmlMeta();
lang.HttpEquiv = "Content-Language";
lang.Content = "zh-cn";
Page.Header.Controls.Add(lang);
//Description
HtmlMeta desc = new HtmlMeta();
desc.Name = "Description";
desc.Content = "Test the meta controls";
Page.Header.Controls.Add(desc);
//Keyword
HtmlMeta keywords = new HtmlMeta();
keywords.Name = "keywords";
keywords.Content = "title,meta,test,page";
Page.Header.Controls.Add(keywords);
}
你应该能看懂
展开全部
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Rlzy_Zxzp" Title="标题名称" %>
也可以在后台代码中设置page.title="标题名称",你的属于哪种情况?
也可以在后台代码中设置page.title="标题名称",你的属于哪种情况?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
需要设置Title = "标题";
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询