'pageTitleClass' could not be found
本文关键字:found be pageTitleClass could not | 更新日期: 2023-09-27 18:28:32
这是我的类,进入App_Code页面Title.cs我收到编译错误。。。
Line 4: <html xmlns="http://www.w3.org/1999/xhtml">
Line 5: <head runat="server">
Line 6: <title><% pageTitleClass pagetitle = new pageTitleClass(); Response.Write(pagetitle.siteTitle); %></title>
Line 7: <link href='http://fonts.googleapis.com/css?family=Roboto&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
Line 8: <link href='http://fonts.googleapis.com/css?family=Roboto+Condensed&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
Source File: d:'inetpub'turkeco.com'www'beta'default.aspx Line: 6
d:'inetpub'turkeco.com'www'beta'default.aspx(6,46): error CS0246: The type or namespace name 'pageTitleClass' could not be found (are you missing a using directive or an assembly reference?)
d:'inetpub'turkeco.com'www'beta'default.aspx(6,15): error CS0246: The type or namespace name 'pageTitleClass' could not be found (are you missing a using directive or an assembly reference?)
public class pageTitleClass
{
public string siteTitle = "PageTitle";
}
它在localhost上工作,但我的托管公司将服务器更新到WindowsServer2008,它给出了错误。这个问题是因为我还是托管公司,我该如何解决?
这看起来是设置页面标题的一种非常奇怪的方式。通常的方法是在CodeBehind类中执行。在Page_Load事件中,设置this.Title = "Page Title";
。
否则,没有足够的信息来帮助你。显然你再也没有遇到编译错误了
它是有效的,但是。。。
但你没有给出W2K8上出现错误的详细信息。如果没有这一点,任何人都无法告诉你。。。。