请教:.net网站新闻详细页面,Title如何调用新闻的标题名称? .net修改TITLE 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如何实现新闻标题+XXXXXXXXX公司名称这块改成:<%=写一个后台方法绑定%> <%@ 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=""; 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+公司名称我是不是有哪个地方没写好啊? 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_; } }} liuchaolin :OK按你的方法可以了,非常感谢! 让.pdf文件直接下载而不是用ie打开的aspX代码怎么写 Enterprise Library DataBase.GetParameterValue()方法问题 进来就又分!! 如何将两张图片连接成一张图片? Gridview的显示问题??(上线等!!) 怎么读取excel 中的内容 大类加小累 如何取得客户端浏览器的internet option中设置的主页? 谁帮我下载一个microsoft sdk for java 4.0公司不能下载郁闷啊 DataGrid模板列中如果使用了自定义控件,如何控制数据绑定和事件响应? .net 访问access数据库 大神、求解答。。!!急急急、
<%=写一个后台方法绑定%>
<%@ 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="";
{
public string _title="News.Title";
protected void Page_Load(object sender, EventArgs e).aspx 标题改成:
<TITLE><%= _title %>+公司名称</TITLE>
结果前台页面就显示成News.Title+公司名称
我是不是有哪个地方没写好啊?
{
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_;
}
}
}