locked
Converting web site to web application throws a lot of error RRS feed

  • Question

  • User-261905420 posted

    I have an ASP.net website that I am trying to convert to a web application.

    My ASP page has this at the top:

    <%@ Page Title="Radiology" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="True" Inherits="WMEXEC.radiology" Codebehind="radiology.aspx.cs" %>

    <span id="lhWP" runat="server">White Plains</span>

    <span id="lhRye" runat="server">White Plains</span>

    <span id="lhS3" runat="server">White Plains</span>

    <span id="lhNR" runat="server">White Plains</span>

    My C# page has this:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    namespace WMEXEC
    {
        public partial class radiology : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                DateTime now = DateTime.Now;
                //DateTime test = DateTime.Now.AddHours(8);
                string time = now.ToString("T");
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + time + "');", true);

                var wpInput = lhWP.InnerText;
                var ryInput = lhRye.InnerText;
                var s3Input = lhS3.InnerText;
                var nrInput = lhNR.InnerText;

            }

        }

    }

    I keep getting this errors:

    Error    13    The name 'lhWP' does not exist in the current context    C:\Users\usrsn\documents\visual studio 2012\Projects\WMEXEC SLN\WMEXEC\radiology.aspx.cs    19    27    WMEXEC
    Error    14    The name 'lhRye' does not exist in the current context    C:\Users\usrsn\documents\visual studio 2012\Projects\WMEXEC SLN\WMEXEC\radiology.aspx.cs    20    27    WMEXEC
    Error    15    The name 'lhS3' does not exist in the current context    C:\Users\usrsn\documents\visual studio 2012\Projects\WMEXEC SLN\WMEXEC\radiology.aspx.cs    21    27    WMEXEC
    Error    16    The name 'lhNR' does not exist in the current context    C:\Users\usrsn\documents\visual studio 2012\Projects\WMEXEC SLN\WMEXEC\radiology.aspx.cs    22    27    WMEXEC

    I created a new web application and tried to do the same thing and it did not give me an error. Do I have to recreate the whole site in a solution for it to work?

    I noticed in the designer page for the new web application it keeps adding a line each time I add a control, but for my existing site, the designer file is blank.

    Friday, May 23, 2014 9:33 AM

Answers