Solved

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

Posted on 2011-09-19
5
375 Views
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
0
Comment
Question by:dpicco
5 Comments
 
LVL 18

Accepted Solution

by:
Ajay Sharma earned 500 total points
Comment Utility
0
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
Comment Utility
Hi,
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.

Regards,
Ram
0
 
LVL 21

Expert Comment

by:tovvenki
Comment Utility
Hi,
what happens when you try to build/rebuild the project?

Regards,
Venki
0
 
LVL 3

Author Closing Comment

by:dpicco
Comment Utility
Thanks. I just had to right click on each file inside VS2010 and convert to web application
0
 
LVL 3

Author Comment

by:dpicco
Comment Utility
After selecting convert to web application, VS2010 will recreate the designer.cs file for you.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now