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.
If you have any concern, please give your response.
Regards
Angie
casp
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
3 Points
46 Posts
Converting web site to web application throws a lot of error
May 23, 2014 09:33 AM|SiKni8|LINK
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.
c asp
All-Star
32817 Points
3815 Posts
Re: Converting web site to web application throws a lot of error
May 25, 2014 10:24 PM|Angie xu - MSFT|LINK
Hi,
Welcome to asp.net forum.
According to your description above, you want to convert a web site project to a web application project.
For this issue, I'd like to suggest you to check your convertion procedure first, you could follow the steps in the link below.
# Converting a Web Site Project to a Web Application Project
http://blogs.msdn.com/b/webdev/archive/2009/10/29/converting-a-web-site-project-to-a-web-application-project.aspx
If you have any concern, please give your response.
Regards
Angie
c asp
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.