asp.net 显示网页标题代码,在本地显示正常,但是上传至网络服务器却不显示

2025-05-15 13:57:55
推荐回答(2个)
回答(1):

你最好在Master的CS文件中定义一个 public方法:


public string temp = "";
public string getTitle(string title)
{ get{ _value = temp;} set{ temp = _value;}}

然后在master 的前台 使用 <%=temp %> 即可。

引用Master页的使用方法:

this.Master.getTitle(xxx); xxx代表你的标题!

回答(2):

this.Master.Page.Title = dc;改成this.Title = dc;