解决方案 »

  1.   

    如何实现新闻标题+XXXXXXXXX公司名称这块改成:
    <%=写一个后台方法绑定%>
      

  2.   

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="new_content.aspx.cs" Inherits="new_content"%><%@ Register Src="~/top.ascx" TagName="top" TagPrefix="MyUserControl" %>
    <%@ Register Src="~/search.ascx" TagName="search" TagPrefix="MyUserControl" %>
    <%@ Register Src="~/product.ascx" TagName="product" TagPrefix="MyUserControl" %>
    <%@ Register Src="~/foot.ascx" TagName="foot" TagPrefix="MyUserControl" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">this.Page.Title=""或者
    <title>如何实现新闻标题+<%= _title %>公司名称</title>public partial class new_content : System.Web.UI.Page
    {
         public string _title="";
        protected void Page_Load(object sender, EventArgs e)
        {
           .........
          _title="";
      

  3.   

    liuchaolin :兄弟我按你的方法二:.aspx.cs 页面里面加了public partial class new_content : System.Web.UI.Page
    {
    public string _title="News.Title";
        protected void Page_Load(object sender, EventArgs e).aspx 标题改成:
    <TITLE><%= _title %>+公司名称</TITLE>
    结果前台页面就显示成News.Title+公司名称
    我是不是有哪个地方没写好啊?
      

  4.   

    public partial class new_content : System.Web.UI.Page
    {
        public string _title="";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["top"] = "News";            if (Request.QueryString["id"] == null || Request.QueryString["type"] == null)
                {
                    return;
                }
                int id = int.Parse(Request.QueryString["id"]);
                int type = int.Parse(Request.QueryString["type"]);
                if (type == 1)
                {
                    lblRightTitle.Text = "公司新闻";
                }
                else
                {
                    lblRightTitle.Text = "行业新闻";
                }
                CN_TB_News News = CN_DALNews.GetNewsById(id);
                litTitle.Text = News.Title_;
                _title=News.Title_;
                litTime.Text = News.Time_.ToShortDateString();
                lblContent.Text = News.Content_;
            }
        }
    }
      

  5.   

    liuchaolin :OK按你的方法可以了,非常感谢!