<title> 绑定数据库字段SiteName </title>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<meta name= "searchtitle " content= "绑定数据库字段SiteTitle " />
<meta name= "author " content= "绑定数据库字段SearchTitle " />
<meta name= "description " content= "绑定数据库字段description " />
<meta name= "keywords " content=绑定数据库字段keywords " />
<meta name= "copyright " content=绑定数据库字段copyright " />
这些绑定怎么写呢?
后台代码又怎么写呢?
解决即结
------解决方案--------------------------------------------------------
前台:
<meta name= "copyright " content= " <%=Readcopyright%> " />
后台:
public string Readcopyright
{
get
{
return ....取得数据库中的copyright;
}
}
理论上可行
------解决方案--------------------------------------------------------
.aspx
<meta name= "copyright " content= " <%=CopyRight%> " />
.cs里
public string CopyRight;
CopyRight = "内容 ";
------解决方案--------------------------------------------------------
aspx
<title> <%=TitleContent%> </title>
cs
public string TitleContent;
TitleContent = "内容 ";
------解决方案--------------------------------------------------------
如果能将这些变量写入缓存
我相信会更好一点吧
不知道怎么来操作
关注中……
------解决方案--------------------------------------------------------
<meta id= "Meta1 " runat= "server ">
<meta id= "Meta2 " runat= "server ">
<title runat= "server " id= "Title1 "> </title>
------解决方案--------------------------------------------------------
<meta name= "searchtitle " content= " <%=绑定数据库字段SiteTitle%> " />
private string _绑定数据库字段SiteTitle = "我是数据库字段值 ";//这个你自己绑定值吧
public string 绑定数据库字段SiteTitle
{
get{return _绑定数据库字段SiteTitle;}
}
------解决方案--------------------------------------------------------
content= " <%=你要绑定的东西%> "
------解决方案--------------------------------------------------------
aspx
<title> <%=TitleContent%> </title>
cs
public string TitleContent;
TitleContent = "绑定数据库中数据 ";
------解决方案--------------------------------------------------------
建议用:
ASPX页里用
<title> <%# ArticleTitle %> </title>
的格式
.cs里面用
ArticleTitle= "绑定字段 "
的格式
很方便的