.net新闻内容页Title如何调用新闻的标题名称? seo

aspx页面title内容:

 <title><%= _title %>-xxxxxxx有限公司</title>
aspx.cs页面内容
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;


public partial class _news_con_aspx : System.Web.UI.Page
{
public string _title="公司新闻";
protected void Page_Load(object sender, EventArgs e)
{

}
}

现在页面显示的是 公司新闻--xxxxxxx有限公司 我现在想要 新闻名称标题-xxxxxxx有限公司
新闻名称标题:新闻标题的名称动态生成的

可以 js <title 给个 id 然后修改成你想要的数据

可以用label,再赋值

看你代码新闻页面你读取数据库后给_title变量附加上新闻标题就好了

 public partial class _news_con_aspx : System.Web.UI.Page
{
public string _title="公司新闻";
protected void Page_Load(object sender, EventArgs e)
{
//读新闻到datareader实例dr中
if(dr.Read()){
_title=dr["title字段名称"].ToString()+"-"+_title;////
}
}
}