简体   繁体   English

将网站转换为 Web 应用程序后编译错误 CS0103

[英]Complie error CS0103 after converting website to webapplication

I have an old website project that I am attempting to convert to a web application.我有一个旧网站项目,我正在尝试将其转换为 Web 应用程序。 After doing the conversion, I am receiving CS0103 errors.完成转换后,我收到 CS0103 错误。 Here is the web page code:这是网页代码:

<%@ Page Language="C#" EnableSessionState="false" Inherits="AutoGenerateDCT" Codebehind="AutoGenerateDCT.aspx.cs" %>
<%@ Register TagPrefix="Wisard" TagName="Header" Src="~/User_Controls/Header.ascx" %>
<%@ Register TagPrefix="Wisard" TagName="Footer" Src="~/User_Controls/Footer.ascx" %>

<!DOCTYPE HTML>
<html>

<head>
    <meta http-equiv="X-UA-Compatible" content="AutoGenerateDCT" />
    <title>WISARD Auto Generated Reports - D.C. Tillman Operations Reports</title>
    <link rel="shortcut icon" href="/Wisard/favicon.ico" /> 
    <link rel="icon" type="image/ico" href="/Wisard/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="/Wisard/Styles/Styles.css" />
    <style type="text/css">
    
        .div-group-name 
        {
            width: 110px;
        }
        
        .div-group-description 
        {
            margin-left: 290px;
        }
        
    </style>
    <script type="text/javascript">

        function onLoad() {
            if ("<%= FileNotFound %>" == "True") {
                window.alert("This report does not exist");
            }
        }

Here is the code behind:这是后面的代码:

public partial class AutoGenerateDCT : SimplePage
{
private String fileNotFound;

private Reports reports;

public override void LoadPage(EventArgs e)
{
    reports = new Reports();

    fileNotFound = Browser.GetCookieValue("FileNotFound");

    Response.Cookies["FileNotFound"].Value = "";

    header.links = "&nbsp;&gt;&gt;&nbsp;<a href=\"/Wisard/App/AutoGenerateGroups.aspx\">Groups</a>&nbsp;&gt;&gt;&nbsp;D.C. Tillman Operations Reports";
}

protected void Page_Unload(Object sender, EventArgs e)
{
    reports?.Dispose();
    reports = null;
}

public String FileNotFound
{
    get { return fileNotFound; }
}

I am getting the CS0103 error for the FileNotFound variable.我收到 FileNotFound 变量的 CS0103 错误。 Any ideas why?任何想法为什么?

Thank You, Tracy谢谢你,特蕾西

I would try under build->rebuild all.我会在 build->rebuild all 下尝试。

This error suggests that the code never been compiled, and it can't resolve that server side expression you have.此错误表明代码从未编译过,并且无法解析您拥有的服务器端表达式。

You could also try running the page, but better would be to try a re-build all.您也可以尝试运行该页面,但最好尝试重新构建所有内容。 If you have some code compile errors, then fix those, and keep on doing a re-build until your code compile errors are gone.如果您有一些代码编译错误,请修复这些错误,并继续进行重新构建,直到您的代码编译错误消失。

Once the compile errors are gone, then that message about the expression (the name does not exist in the current context) should go away.一旦编译错误消失,关于表达式的消息(名称在当前上下文中不存在)应该消失。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET中的错误CS0103 - error CS0103 in ASP.NET ASP.NET MVC3中的编译错误CS0103 - Compilation Error CS0103 in ASP.NET MVC3 调试 Visual Studio 代码中的 CS0103 错误 - Debugging CS0103 Error in Visual Studio code 错误CS0103:名称“ txtReferralCode”在当前上下文中不存在 - error CS0103: The name 'txtReferralCode' does not exist in the current context 如何解决Razor Pages错误“ CS0103当前上下文中不存在名称&#39;Json&#39;”? - How do I solve the Razor Pages error “CS0103 The name 'Json' does not exist in the current context”? 编译器错误消息:CS0103:当前上下文中不存在名称“ listBox1” - Compiler Error Message: CS0103: The name 'listBox1' does not exist in the current context FluentValidation“错误 cs0103 当前上下文中不存在名称‘x’”.asp.net 核心 2.1 - FluentValidation "Error cs0103 the name 'x' does not exist in the current context" .asp.net core 2.1 编译器错误消息:CS0103:当前上下文中不存在名称“Test1” - Compiler Error Message: CS0103: The name 'Test1' does not exist in the current context 编译器错误消息:CS0103:名称“绑定”在当前上下文中不存在 - Compiler Error Message: CS0103: The name 'Bind' does not exist in the current context 无效的Intellisense错误CS0103 ASP.NET网站“该名称在当前上下文中不存在” - Invalid Intellisense error CS0103 ASP.NET Web Site “The name does not exist in the current context”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM