ASP.NET 4.0 web page moved from web site to web project doesn't work

Posted on 2011-09-19
Last Modified: 2013-11-27
Hello experts,
I have a "web site" that I created in Visual Studio that I want to convert into a "web project" in Visual Studio 2010. I created the "web project" in a new location and then moved my .aspx and .aspx.cs files into that new location and added them/included into my project from Visual Studio and set it as my start page.

The problem is that the controls on the aspx page (for example: lblUploadStatus) are not recognized from my .cs page. I'm getting "The name lblUploadStatus does not exist in the current context."

Does anyone know how to fix? I was working fine in my "web site". Also I noticed that I don't have a .aspx.designer.cs file. Is that part of the problem? Thanks. error message screen shot
Question by:dpicco
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Accepted Solution

Ajay Sharma earned 500 total points
ID: 36565005
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 36565937
I faced the same problem some time before. Only solution I fould at that time was to create new pages in new web project and then copy paste the code  from old pages to new pages. Actully its irritating process if you have too many files to add. But you can give a try. I don't know if there is a valid process suported by visual studio.

LVL 21

Expert Comment

ID: 36566281
what happens when you try to build/rebuild the project?


Author Closing Comment

ID: 36566744
Thanks. I just had to right click on each file inside VS2010 and convert to web application

Author Comment

ID: 36566752
After selecting convert to web application, VS2010 will recreate the designer.cs file for you.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I do Unit Testing with Session ? 1 23
Level out logo and increase size? 16 24
Nested forach loop to linq 3 24
Secure log in 'box' 4 9
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question